mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Add Obfuscation helper for armor change impl
Also alphabetize the importmcdev script... heathens, all of you
This commit is contained in:
parent
c849f4f132
commit
9650c9dddc
2 changed files with 17 additions and 4 deletions
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
index 135a9c0e..5e17d107 100644
|
index 135a9c0e..559aebf2 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
@@ -0,0 +0,0 @@
|
@@ -0,0 +0,0 @@
|
||||||
|
@ -20,7 +20,7 @@ index 135a9c0e..5e17d107 100644
|
||||||
|
|
||||||
if (!ItemStack.matches(itemstack1, itemstack)) {
|
if (!ItemStack.matches(itemstack1, itemstack)) {
|
||||||
+ // Paper start - PlayerArmorChangeEvent
|
+ // Paper start - PlayerArmorChangeEvent
|
||||||
+ if (this instanceof EntityPlayer && enumitemslot.a() == EnumItemSlot.Function.ARMOR && !itemstack.getItem().equals(itemstack1.getItem())) {
|
+ if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR && !itemstack.getItem().equals(itemstack1.getItem())) {
|
||||||
+ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack);
|
+ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack);
|
||||||
+ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1);
|
+ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1);
|
||||||
+ new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent();
|
+ new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent();
|
||||||
|
@ -29,4 +29,16 @@ index 135a9c0e..5e17d107 100644
|
||||||
((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1)));
|
((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1)));
|
||||||
if (!itemstack.isEmpty()) {
|
if (!itemstack.isEmpty()) {
|
||||||
this.getAttributeMap().a(itemstack.a(enumitemslot));
|
this.getAttributeMap().a(itemstack.a(enumitemslot));
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EnumItemSlot.java b/src/main/java/net/minecraft/server/EnumItemSlot.java
|
||||||
|
index cdf3a3ba..be5d0bf8 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EnumItemSlot.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EnumItemSlot.java
|
||||||
|
@@ -0,0 +0,0 @@ public enum EnumItemSlot {
|
||||||
|
this.j = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public EnumItemSlot.Function getType() { return this.a(); } // Paper - OBFHELPER
|
||||||
|
public EnumItemSlot.Function a() {
|
||||||
|
return this.g;
|
||||||
|
}
|
||||||
--
|
--
|
|
@ -63,10 +63,11 @@ import DataInspectorBlockEntity
|
||||||
import DataPalette
|
import DataPalette
|
||||||
import DefinedStructure
|
import DefinedStructure
|
||||||
import EntityLlama
|
import EntityLlama
|
||||||
import EULA
|
|
||||||
import EntitySquid
|
import EntitySquid
|
||||||
import EntityTypes
|
import EntityTypes
|
||||||
import EntityWaterAnimal
|
import EntityWaterAnimal
|
||||||
|
import EnumItemSlot
|
||||||
|
import EULA
|
||||||
import FileIOThread
|
import FileIOThread
|
||||||
import IHopper
|
import IHopper
|
||||||
import ItemBlock
|
import ItemBlock
|
||||||
|
@ -75,7 +76,6 @@ import ItemMonsterEgg
|
||||||
import NavigationAbstract
|
import NavigationAbstract
|
||||||
import NBTTagCompound
|
import NBTTagCompound
|
||||||
import NBTTagList
|
import NBTTagList
|
||||||
import PersistentScoreboard
|
|
||||||
import PacketPlayInUseEntity
|
import PacketPlayInUseEntity
|
||||||
import PacketPlayOutMapChunk
|
import PacketPlayOutMapChunk
|
||||||
import PacketPlayOutPlayerListHeaderFooter
|
import PacketPlayOutPlayerListHeaderFooter
|
||||||
|
@ -87,6 +87,7 @@ import PathfinderGoal
|
||||||
import PathfinderGoalFloat
|
import PathfinderGoalFloat
|
||||||
import PathfinderGoalGotoTarget
|
import PathfinderGoalGotoTarget
|
||||||
import PathfinderWater
|
import PathfinderWater
|
||||||
|
import PersistentScoreboard
|
||||||
import PersistentVillage
|
import PersistentVillage
|
||||||
import PlayerConnectionUtils
|
import PlayerConnectionUtils
|
||||||
import RegionFile
|
import RegionFile
|
||||||
|
|
Loading…
Reference in a new issue