#1209: Clean up various patches
By: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
This commit is contained in:
@@ -83,16 +83,7 @@
|
||||
public static ItemStack of(NBTTagCompound nbttagcompound) {
|
||||
try {
|
||||
return new ItemStack(nbttagcompound);
|
||||
@@ -229,7 +284,7 @@
|
||||
return this.getItem().builtInRegistryHolder().tags();
|
||||
}
|
||||
|
||||
- public EnumInteractionResult useOn(ItemActionContext itemactioncontext) {
|
||||
+ public EnumInteractionResult useOn(ItemActionContext itemactioncontext, EnumHand enumhand) { // CraftBukkit - add hand
|
||||
EntityHuman entityhuman = itemactioncontext.getPlayer();
|
||||
BlockPosition blockposition = itemactioncontext.getClickedPos();
|
||||
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getLevel(), blockposition, false);
|
||||
@@ -237,12 +292,186 @@
|
||||
@@ -237,12 +292,187 @@
|
||||
if (entityhuman != null && !entityhuman.getAbilities().mayBuild && !this.hasAdventureModePlaceTagForBlock(itemactioncontext.getLevel().registryAccess().registryOrThrow(Registries.BLOCK), shapedetectorblock)) {
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
@@ -152,6 +143,7 @@
|
||||
|
||||
if (entityhuman != null && enuminteractionresult.shouldAwardStats()) {
|
||||
- entityhuman.awardStat(StatisticList.ITEM_USED.get(item));
|
||||
+ EnumHand enumhand = itemactioncontext.getHand();
|
||||
+ org.bukkit.event.block.BlockPlaceEvent placeEvent = null;
|
||||
+ List<BlockState> blocks = new java.util.ArrayList<>(world.capturedBlockStates.values());
|
||||
+ world.capturedBlockStates.clear();
|
||||
@@ -280,7 +272,7 @@
|
||||
|
||||
return enuminteractionresult;
|
||||
}
|
||||
@@ -323,6 +552,21 @@
|
||||
@@ -323,6 +553,21 @@
|
||||
}
|
||||
|
||||
i -= k;
|
||||
@@ -302,7 +294,7 @@
|
||||
if (i <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -344,6 +588,11 @@
|
||||
@@ -344,6 +589,11 @@
|
||||
if (this.hurt(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
||||
consumer.accept(t0);
|
||||
Item item = this.getItem();
|
||||
@@ -314,7 +306,7 @@
|
||||
|
||||
this.shrink(1);
|
||||
if (t0 instanceof EntityHuman) {
|
||||
@@ -492,6 +741,17 @@
|
||||
@@ -492,6 +742,17 @@
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
@@ -332,7 +324,7 @@
|
||||
public NBTTagCompound getOrCreateTag() {
|
||||
if (this.tag == null) {
|
||||
this.setTag(new NBTTagCompound());
|
||||
@@ -862,6 +1122,12 @@
|
||||
@@ -862,6 +1123,12 @@
|
||||
}
|
||||
|
||||
public void setRepairCost(int i) {
|
||||
@@ -345,7 +337,7 @@
|
||||
this.getOrCreateTag().putInt("RepairCost", i);
|
||||
}
|
||||
|
||||
@@ -911,6 +1177,13 @@
|
||||
@@ -911,6 +1178,13 @@
|
||||
nbttaglist.add(nbttagcompound);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user