@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/ItemArmor.java
|
||||
+++ b/net/minecraft/server/ItemArmor.java
|
||||
@@ -6,6 +6,11 @@
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
--- a/net/minecraft/world/item/ItemArmor.java
|
||||
+++ b/net/minecraft/world/item/ItemArmor.java
|
||||
@@ -25,6 +25,11 @@
|
||||
import net.minecraft.world.level.block.BlockDispenser;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -12,7 +12,7 @@
|
||||
public class ItemArmor extends Item implements ItemWearable {
|
||||
|
||||
private static final UUID[] j = new UUID[]{UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")};
|
||||
@@ -32,6 +37,32 @@
|
||||
@@ -51,6 +56,32 @@
|
||||
EntityLiving entityliving = (EntityLiving) list.get(0);
|
||||
EnumItemSlot enumitemslot = EntityInsentient.j(itemstack);
|
||||
ItemStack itemstack1 = itemstack.cloneAndSubtract(1);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemArmorStand.java
|
||||
+++ b/net/minecraft/server/ItemArmorStand.java
|
||||
@@ -38,6 +38,11 @@
|
||||
--- a/net/minecraft/world/item/ItemArmorStand.java
|
||||
+++ b/net/minecraft/world/item/ItemArmorStand.java
|
||||
@@ -58,6 +58,11 @@
|
||||
|
||||
entityarmorstand.setPositionRotation(entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), f, 0.0F);
|
||||
this.a(entityarmorstand, world.random);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
--- a/net/minecraft/server/ItemBlock.java
|
||||
+++ b/net/minecraft/server/ItemBlock.java
|
||||
@@ -4,6 +4,12 @@
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/item/ItemBlock.java
|
||||
+++ b/net/minecraft/world/item/ItemBlock.java
|
||||
@@ -25,6 +25,13 @@
|
||||
import net.minecraft.world.level.block.state.properties.IBlockState;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
+import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
+import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
+import org.bukkit.event.block.BlockCanBuildEvent;
|
||||
@@ -13,7 +14,7 @@
|
||||
public class ItemBlock extends Item {
|
||||
|
||||
@Deprecated
|
||||
@@ -31,6 +37,12 @@
|
||||
@@ -52,6 +59,12 @@
|
||||
return EnumInteractionResult.FAIL;
|
||||
} else {
|
||||
IBlockData iblockdata = this.c(blockactioncontext1);
|
||||
@@ -26,7 +27,7 @@
|
||||
|
||||
if (iblockdata == null) {
|
||||
return EnumInteractionResult.FAIL;
|
||||
@@ -48,6 +60,15 @@
|
||||
@@ -69,6 +82,15 @@
|
||||
iblockdata1 = this.a(blockposition, world, itemstack, iblockdata1);
|
||||
this.a(blockposition, world, entityhuman, itemstack, iblockdata1);
|
||||
block.postPlace(world, blockposition, iblockdata1, entityhuman, itemstack);
|
||||
@@ -42,7 +43,7 @@
|
||||
if (entityhuman instanceof EntityPlayer) {
|
||||
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition, itemstack);
|
||||
}
|
||||
@@ -55,8 +76,8 @@
|
||||
@@ -76,8 +98,8 @@
|
||||
|
||||
SoundEffectType soundeffecttype = iblockdata1.getStepSound();
|
||||
|
||||
@@ -53,7 +54,7 @@
|
||||
itemstack.subtract(1);
|
||||
}
|
||||
|
||||
@@ -92,6 +113,21 @@
|
||||
@@ -113,6 +135,21 @@
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("BlockStateTag");
|
||||
@@ -75,7 +76,7 @@
|
||||
BlockStateList<Block, IBlockData> blockstatelist = iblockdata.getBlock().getStates();
|
||||
Iterator iterator = nbttagcompound1.getKeys().iterator();
|
||||
|
||||
@@ -106,11 +142,6 @@
|
||||
@@ -127,11 +164,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,7 +88,7 @@
|
||||
return iblockdata1;
|
||||
}
|
||||
|
||||
@@ -123,8 +154,15 @@
|
||||
@@ -144,8 +176,15 @@
|
||||
protected boolean b(BlockActionContext blockactioncontext, IBlockData iblockdata) {
|
||||
EntityHuman entityhuman = blockactioncontext.getEntity();
|
||||
VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a((Entity) entityhuman);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemBoat.java
|
||||
+++ b/net/minecraft/server/ItemBoat.java
|
||||
@@ -41,6 +41,13 @@
|
||||
--- a/net/minecraft/world/item/ItemBoat.java
|
||||
+++ b/net/minecraft/world/item/ItemBoat.java
|
||||
@@ -54,6 +54,13 @@
|
||||
}
|
||||
|
||||
if (movingobjectpositionblock.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK) {
|
||||
@@ -8,13 +8,13 @@
|
||||
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectpositionblock.getBlockPosition(), movingobjectpositionblock.getDirection(), itemstack, enumhand);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
|
||||
+ return InteractionResultWrapper.pass(itemstack);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
EntityBoat entityboat = new EntityBoat(world, movingobjectpositionblock.getPos().x, movingobjectpositionblock.getPos().y, movingobjectpositionblock.getPos().z);
|
||||
|
||||
entityboat.setType(this.b);
|
||||
@@ -49,7 +56,15 @@
|
||||
@@ -62,7 +69,15 @@
|
||||
return InteractionResultWrapper.fail(itemstack);
|
||||
} else {
|
||||
if (!world.isClientSide) {
|
||||
@@ -25,7 +25,7 @@
|
||||
+ }
|
||||
+
|
||||
+ if (!world.addEntity(entityboat)) {
|
||||
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
|
||||
+ return InteractionResultWrapper.pass(itemstack);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemBoneMeal.java
|
||||
+++ b/net/minecraft/server/ItemBoneMeal.java
|
||||
@@ -12,6 +12,12 @@
|
||||
--- a/net/minecraft/world/item/ItemBoneMeal.java
|
||||
+++ b/net/minecraft/world/item/ItemBoneMeal.java
|
||||
@@ -28,6 +28,12 @@
|
||||
|
||||
@Override
|
||||
public EnumInteractionResult a(ItemActionContext itemactioncontext) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemBow.java
|
||||
+++ b/net/minecraft/server/ItemBow.java
|
||||
@@ -50,6 +50,14 @@
|
||||
--- a/net/minecraft/world/item/ItemBow.java
|
||||
+++ b/net/minecraft/world/item/ItemBow.java
|
||||
@@ -61,6 +61,14 @@
|
||||
if (EnchantmentManager.getEnchantmentLevel(Enchantments.ARROW_FIRE, itemstack) > 0) {
|
||||
entityarrow.setOnFire(100);
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
||||
entityhuman1.broadcastItemBreak(entityhuman.getRaisedHand());
|
||||
@@ -58,7 +66,16 @@
|
||||
@@ -69,7 +77,16 @@
|
||||
entityarrow.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
+ // CraftBukkit start
|
||||
+ if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
||||
+ if (!world.addEntity(entityarrow)) {
|
||||
+ if (entityhuman instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
--- a/net/minecraft/server/ItemBucket.java
|
||||
+++ b/net/minecraft/server/ItemBucket.java
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/item/ItemBucket.java
|
||||
+++ b/net/minecraft/world/item/ItemBucket.java
|
||||
@@ -29,6 +29,16 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutBlockChange;
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
|
||||
@@ -15,7 +17,7 @@
|
||||
public class ItemBucket extends Item {
|
||||
|
||||
public final FluidType fluidType;
|
||||
@@ -32,12 +40,22 @@
|
||||
@@ -59,12 +69,22 @@
|
||||
if (this.fluidType == FluidTypes.EMPTY) {
|
||||
iblockdata = world.getType(blockposition);
|
||||
if (iblockdata.getBlock() instanceof IFluidSource) {
|
||||
@@ -26,7 +28,7 @@
|
||||
+ if (event.isCancelled()) {
|
||||
+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-5163 (see PlayerInteractManager)
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
|
||||
+ return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
|
||||
+ return InteractionResultWrapper.fail(itemstack);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
FluidType fluidtype = ((IFluidSource) iblockdata.getBlock()).removeFluid(world, blockposition, iblockdata);
|
||||
@@ -39,7 +41,7 @@
|
||||
|
||||
if (!world.isClientSide) {
|
||||
CriterionTriggers.j.a((EntityPlayer) entityhuman, new ItemStack(fluidtype.a()));
|
||||
@@ -52,7 +70,7 @@
|
||||
@@ -79,7 +99,7 @@
|
||||
iblockdata = world.getType(blockposition);
|
||||
BlockPosition blockposition2 = iblockdata.getBlock() instanceof IFluidContainer && this.fluidType == FluidTypes.WATER ? blockposition : blockposition1;
|
||||
|
||||
@@ -48,7 +50,7 @@
|
||||
this.a(world, itemstack, blockposition2);
|
||||
if (entityhuman instanceof EntityPlayer) {
|
||||
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition2, itemstack);
|
||||
@@ -77,6 +95,11 @@
|
||||
@@ -104,6 +124,11 @@
|
||||
public void a(World world, ItemStack itemstack, BlockPosition blockposition) {}
|
||||
|
||||
public boolean a(@Nullable EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
@@ -60,7 +62,7 @@
|
||||
if (!(this.fluidType instanceof FluidTypeFlowing)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -86,8 +109,18 @@
|
||||
@@ -113,8 +138,18 @@
|
||||
boolean flag = iblockdata.a(this.fluidType);
|
||||
boolean flag1 = iblockdata.isAir() || flag || block instanceof IFluidContainer && ((IFluidContainer) block).canPlace(world, blockposition, iblockdata, this.fluidType);
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
--- a/net/minecraft/server/ItemChorusFruit.java
|
||||
+++ b/net/minecraft/server/ItemChorusFruit.java
|
||||
@@ -1,5 +1,11 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/ItemChorusFruit.java
|
||||
+++ b/net/minecraft/world/item/ItemChorusFruit.java
|
||||
@@ -9,6 +9,13 @@
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.server.level.EntityPlayer;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
@@ -12,7 +14,7 @@
|
||||
public class ItemChorusFruit extends Item {
|
||||
|
||||
public ItemChorusFruit(Item.Info item_info) {
|
||||
@@ -20,6 +26,20 @@
|
||||
@@ -29,6 +36,20 @@
|
||||
double d4 = MathHelper.a(entityliving.locY() + (double) (entityliving.getRandom().nextInt(16) - 8), 0.0D, (double) (world.getHeight() - 1));
|
||||
double d5 = entityliving.locZ() + (entityliving.getRandom().nextDouble() - 0.5D) * 16.0D;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemCrossbow.java
|
||||
+++ b/net/minecraft/server/ItemCrossbow.java
|
||||
@@ -74,6 +74,10 @@
|
||||
--- a/net/minecraft/world/item/ItemCrossbow.java
|
||||
+++ b/net/minecraft/world/item/ItemCrossbow.java
|
||||
@@ -97,6 +97,10 @@
|
||||
if (itemstack1.isEmpty() && flag) {
|
||||
itemstack1 = new ItemStack(Items.ARROW);
|
||||
itemstack2 = itemstack1.cloneItemStack();
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
|
||||
if (!a(entityliving, itemstack, itemstack1, k > 0, flag)) {
|
||||
@@ -198,11 +202,27 @@
|
||||
@@ -221,11 +225,27 @@
|
||||
vector3fa.a(quaternion);
|
||||
((IProjectile) object).shoot((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c(), f1, f2);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/server/ItemDye.java
|
||||
+++ b/net/minecraft/server/ItemDye.java
|
||||
@@ -3,6 +3,8 @@
|
||||
import com.google.common.collect.Maps;
|
||||
import java.util.Map;
|
||||
--- a/net/minecraft/world/item/ItemDye.java
|
||||
+++ b/net/minecraft/world/item/ItemDye.java
|
||||
@@ -8,6 +8,8 @@
|
||||
import net.minecraft.world.entity.animal.EntitySheep;
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
|
||||
+import org.bukkit.event.entity.SheepDyeWoolEvent; // CraftBukkit
|
||||
+
|
||||
public class ItemDye extends Item {
|
||||
|
||||
private static final Map<EnumColor, ItemDye> a = Maps.newEnumMap(EnumColor.class);
|
||||
@@ -21,7 +23,17 @@
|
||||
@@ -26,7 +28,17 @@
|
||||
|
||||
if (entitysheep.isAlive() && !entitysheep.isSheared() && entitysheep.getColor() != this.b) {
|
||||
if (!entityhuman.world.isClientSide) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemEgg.java
|
||||
+++ b/net/minecraft/server/ItemEgg.java
|
||||
@@ -10,14 +10,22 @@
|
||||
--- a/net/minecraft/world/item/ItemEgg.java
|
||||
+++ b/net/minecraft/world/item/ItemEgg.java
|
||||
@@ -19,14 +19,22 @@
|
||||
public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) {
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
- world.addEntity(entityegg);
|
||||
+ // CraftBukkit start
|
||||
+ if (!world.addEntity(entityegg)) {
|
||||
+ if (entityhuman instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
+ return InteractionResultWrapper.fail(itemstack);
|
||||
+ }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemEndCrystal.java
|
||||
+++ b/net/minecraft/server/ItemEndCrystal.java
|
||||
@@ -34,6 +34,11 @@
|
||||
--- a/net/minecraft/world/item/ItemEndCrystal.java
|
||||
+++ b/net/minecraft/world/item/ItemEndCrystal.java
|
||||
@@ -45,6 +45,11 @@
|
||||
EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(world, d0 + 0.5D, d1, d2 + 0.5D);
|
||||
|
||||
entityendercrystal.setShowingBottom(false);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemEnderEye.java
|
||||
+++ b/net/minecraft/server/ItemEnderEye.java
|
||||
@@ -61,7 +61,11 @@
|
||||
--- a/net/minecraft/world/item/ItemEnderEye.java
|
||||
+++ b/net/minecraft/world/item/ItemEnderEye.java
|
||||
@@ -85,7 +85,11 @@
|
||||
|
||||
entityendersignal.setItem(itemstack);
|
||||
entityendersignal.a(blockposition);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemEnderPearl.java
|
||||
+++ b/net/minecraft/server/ItemEnderPearl.java
|
||||
@@ -10,16 +10,24 @@
|
||||
--- a/net/minecraft/world/item/ItemEnderPearl.java
|
||||
+++ b/net/minecraft/world/item/ItemEnderPearl.java
|
||||
@@ -19,16 +19,24 @@
|
||||
public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) {
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
entityenderpearl.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, 1.0F);
|
||||
- world.addEntity(entityenderpearl);
|
||||
+ if (!world.addEntity(entityenderpearl)) {
|
||||
+ if (entityhuman instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
+ return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
|
||||
+ return InteractionResultWrapper.fail(itemstack);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemFireball.java
|
||||
+++ b/net/minecraft/server/ItemFireball.java
|
||||
@@ -14,12 +14,28 @@
|
||||
--- a/net/minecraft/world/item/ItemFireball.java
|
||||
+++ b/net/minecraft/world/item/ItemFireball.java
|
||||
@@ -26,12 +26,28 @@
|
||||
boolean flag = false;
|
||||
|
||||
if (BlockCampfire.h(iblockdata)) {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
--- a/net/minecraft/server/ItemFishingRod.java
|
||||
+++ b/net/minecraft/server/ItemFishingRod.java
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/ItemFishingRod.java
|
||||
+++ b/net/minecraft/world/item/ItemFishingRod.java
|
||||
@@ -10,6 +10,8 @@
|
||||
import net.minecraft.world.item.enchantment.EnchantmentManager;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+import org.bukkit.event.player.PlayerFishEvent; // CraftBukkit
|
||||
+
|
||||
public class ItemFishingRod extends Item implements ItemVanishable {
|
||||
|
||||
public ItemFishingRod(Item.Info item_info) {
|
||||
@@ -21,12 +23,23 @@
|
||||
@@ -31,12 +33,23 @@
|
||||
|
||||
world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
} else {
|
||||
@@ -26,7 +27,7 @@
|
||||
+
|
||||
+ if (playerFishEvent.isCancelled()) {
|
||||
+ entityhuman.hookedFish = null;
|
||||
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
|
||||
+ return InteractionResultWrapper.pass(itemstack);
|
||||
+ }
|
||||
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
+ world.addEntity(entityfishinghook);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemFlintAndSteel.java
|
||||
+++ b/net/minecraft/server/ItemFlintAndSteel.java
|
||||
@@ -13,7 +13,7 @@
|
||||
--- a/net/minecraft/world/item/ItemFlintAndSteel.java
|
||||
+++ b/net/minecraft/world/item/ItemFlintAndSteel.java
|
||||
@@ -28,7 +28,7 @@
|
||||
BlockPosition blockposition = itemactioncontext.getClickPosition();
|
||||
IBlockData iblockdata = world.getType(blockposition);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
world.playSound(entityhuman, blockposition, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.RANDOM.nextFloat() * 0.4F + 0.8F);
|
||||
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true), 11);
|
||||
if (entityhuman != null) {
|
||||
@@ -27,6 +27,14 @@
|
||||
@@ -42,6 +42,14 @@
|
||||
BlockPosition blockposition1 = blockposition.shift(itemactioncontext.getClickedFace());
|
||||
|
||||
if (BlockFireAbstract.a(world, blockposition1, itemactioncontext.f())) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/ItemHanging.java
|
||||
+++ b/net/minecraft/server/ItemHanging.java
|
||||
@@ -1,5 +1,10 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/ItemHanging.java
|
||||
+++ b/net/minecraft/world/item/ItemHanging.java
|
||||
@@ -13,6 +13,11 @@
|
||||
import net.minecraft.world.item.context.ItemActionContext;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.entity.Player;
|
||||
@@ -11,7 +12,7 @@
|
||||
public class ItemHanging extends Item {
|
||||
|
||||
private final EntityTypes<? extends EntityHanging> a;
|
||||
@@ -41,6 +46,18 @@
|
||||
@@ -54,6 +59,18 @@
|
||||
|
||||
if (((EntityHanging) object).survives()) {
|
||||
if (!world.isClientSide) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/server/ItemLeash.java
|
||||
+++ b/net/minecraft/server/ItemLeash.java
|
||||
@@ -3,6 +3,8 @@
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
--- a/net/minecraft/world/item/ItemLeash.java
|
||||
+++ b/net/minecraft/world/item/ItemLeash.java
|
||||
@@ -14,6 +14,8 @@
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
+import org.bukkit.event.hanging.HangingPlaceEvent; // CraftBukkit
|
||||
+
|
||||
public class ItemLeash extends Item {
|
||||
|
||||
public ItemLeash(Item.Info item_info) {
|
||||
@@ -44,7 +46,23 @@
|
||||
@@ -55,7 +57,23 @@
|
||||
if (entityinsentient.getLeashHolder() == entityhuman) {
|
||||
if (entityleash == null) {
|
||||
entityleash = EntityLeash.a(world, blockposition);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemMilkBucket.java
|
||||
+++ b/net/minecraft/server/ItemMilkBucket.java
|
||||
@@ -20,7 +20,7 @@
|
||||
--- a/net/minecraft/world/item/ItemMilkBucket.java
|
||||
+++ b/net/minecraft/world/item/ItemMilkBucket.java
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
if (!world.isClientSide) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/ItemMinecart.java
|
||||
+++ b/net/minecraft/server/ItemMinecart.java
|
||||
@@ -1,5 +1,10 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/ItemMinecart.java
|
||||
+++ b/net/minecraft/world/item/ItemMinecart.java
|
||||
@@ -18,6 +18,11 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.block.state.properties.BlockPropertyTrackPosition;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -11,7 +12,7 @@
|
||||
public class ItemMinecart extends Item {
|
||||
|
||||
private static final IDispenseBehavior a = new DispenseBehaviorItem() {
|
||||
@@ -38,14 +43,43 @@
|
||||
@@ -56,14 +61,43 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +59,7 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@@ -87,7 +121,12 @@
|
||||
@@ -105,7 +139,12 @@
|
||||
entityminecartabstract.setCustomName(itemstack.getName());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemMonsterEgg.java
|
||||
+++ b/net/minecraft/server/ItemMonsterEgg.java
|
||||
@@ -141,7 +141,7 @@
|
||||
--- a/net/minecraft/world/item/ItemMonsterEgg.java
|
||||
+++ b/net/minecraft/world/item/ItemMonsterEgg.java
|
||||
@@ -167,7 +167,7 @@
|
||||
return Optional.empty();
|
||||
} else {
|
||||
((EntityInsentient) object).setPositionRotation(vec3d.getX(), vec3d.getY(), vec3d.getZ(), 0.0F, 0.0F);
|
||||
@@ -9,7 +9,7 @@
|
||||
if (itemstack.hasName()) {
|
||||
((EntityInsentient) object).setCustomName(itemstack.getName());
|
||||
}
|
||||
@@ -150,7 +150,7 @@
|
||||
@@ -176,7 +176,7 @@
|
||||
itemstack.subtract(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemPotion.java
|
||||
+++ b/net/minecraft/server/ItemPotion.java
|
||||
@@ -32,7 +32,7 @@
|
||||
--- a/net/minecraft/world/item/ItemPotion.java
|
||||
+++ b/net/minecraft/world/item/ItemPotion.java
|
||||
@@ -46,7 +46,7 @@
|
||||
if (mobeffect.getMobEffect().isInstant()) {
|
||||
mobeffect.getMobEffect().applyInstantEffect(entityhuman, entityhuman, entityliving, mobeffect.getAmplifier(), 1.0D);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemRecord.java
|
||||
+++ b/net/minecraft/server/ItemRecord.java
|
||||
@@ -26,6 +26,7 @@
|
||||
--- a/net/minecraft/world/item/ItemRecord.java
|
||||
+++ b/net/minecraft/world/item/ItemRecord.java
|
||||
@@ -37,6 +37,7 @@
|
||||
ItemStack itemstack = itemactioncontext.getItemStack();
|
||||
|
||||
if (!world.isClientSide) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemSign.java
|
||||
+++ b/net/minecraft/server/ItemSign.java
|
||||
@@ -4,6 +4,8 @@
|
||||
--- a/net/minecraft/world/item/ItemSign.java
|
||||
+++ b/net/minecraft/world/item/ItemSign.java
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
public class ItemSign extends ItemBlockWallable {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public ItemSign(Item.Info item_info, Block block, Block block1) {
|
||||
super(block, block1, item_info);
|
||||
}
|
||||
@@ -13,7 +15,10 @@
|
||||
@@ -19,7 +21,10 @@
|
||||
boolean flag = super.a(blockposition, world, entityhuman, itemstack, iblockdata);
|
||||
|
||||
if (!world.isClientSide && !flag && entityhuman != null) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/server/ItemSkullPlayer.java
|
||||
+++ b/net/minecraft/server/ItemSkullPlayer.java
|
||||
@@ -44,6 +44,15 @@
|
||||
--- a/net/minecraft/world/item/ItemSkullPlayer.java
|
||||
+++ b/net/minecraft/world/item/ItemSkullPlayer.java
|
||||
@@ -50,6 +50,15 @@
|
||||
nbttagcompound.set("SkullOwner", GameProfileSerializer.serialize(new NBTTagCompound(), gameprofile));
|
||||
return true;
|
||||
} else {
|
||||
+ // CraftBukkit start
|
||||
+ NBTTagList textures = nbttagcompound.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts
|
||||
+ net.minecraft.nbt.NBTTagList textures = nbttagcompound.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts
|
||||
+ for (int i = 0; i < textures.size(); i++) {
|
||||
+ if (textures.get(i) instanceof NBTTagCompound && !((NBTTagCompound) textures.get(i)).hasKeyOfType("Signature", 8) && ((NBTTagCompound) textures.get(i)).getString("Value").trim().isEmpty()) {
|
||||
+ nbttagcompound.remove("SkullOwner");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemSnowball.java
|
||||
+++ b/net/minecraft/server/ItemSnowball.java
|
||||
@@ -10,19 +10,32 @@
|
||||
--- a/net/minecraft/world/item/ItemSnowball.java
|
||||
+++ b/net/minecraft/world/item/ItemSnowball.java
|
||||
@@ -19,19 +19,32 @@
|
||||
public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) {
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
+ }
|
||||
+
|
||||
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
+ } else if (entityhuman instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ } else if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemStack.java
|
||||
+++ b/net/minecraft/server/ItemStack.java
|
||||
@@ -19,6 +19,24 @@
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -58,6 +58,39 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -8,7 +8,22 @@
|
||||
+import com.mojang.serialization.Dynamic;
|
||||
+import java.util.List;
|
||||
+import java.util.Map;
|
||||
+
|
||||
+import net.minecraft.core.EnumDirection;
|
||||
+import net.minecraft.nbt.DynamicOpsNBT;
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutBlockChange;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
+import net.minecraft.sounds.SoundCategory;
|
||||
+import net.minecraft.util.datafix.fixes.DataConverterTypes;
|
||||
+import net.minecraft.world.level.block.BlockJukeBox;
|
||||
+import net.minecraft.world.level.block.BlockSapling;
|
||||
+import net.minecraft.world.level.block.BlockTileEntity;
|
||||
+import net.minecraft.world.level.block.BlockWitherSkull;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
+import net.minecraft.world.level.block.SoundEffectType;
|
||||
+import net.minecraft.world.level.block.entity.TileEntity;
|
||||
+import net.minecraft.world.level.block.entity.TileEntitySign;
|
||||
+import net.minecraft.world.level.block.entity.TileEntitySkull;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.TreeType;
|
||||
+import org.bukkit.block.BlockState;
|
||||
@@ -25,7 +40,7 @@
|
||||
public final class ItemStack {
|
||||
|
||||
public static final Codec<ItemStack> a = RecordCodecBuilder.create((instance) -> {
|
||||
@@ -32,7 +50,7 @@
|
||||
@@ -71,7 +104,7 @@
|
||||
});
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
public static final ItemStack b = new ItemStack((Item) null);
|
||||
@@ -34,7 +49,7 @@
|
||||
decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
|
||||
});
|
||||
private static final ChatModifier e = ChatModifier.a.setColor(EnumChatFormat.DARK_PURPLE).setItalic(true);
|
||||
@@ -67,23 +85,42 @@
|
||||
@@ -106,23 +139,42 @@
|
||||
this.checkEmpty();
|
||||
}
|
||||
|
||||
@@ -80,7 +95,7 @@
|
||||
this.checkEmpty();
|
||||
}
|
||||
|
||||
@@ -113,7 +150,7 @@
|
||||
@@ -152,7 +204,7 @@
|
||||
return this.j ? Items.AIR : this.item;
|
||||
}
|
||||
|
||||
@@ -89,7 +104,7 @@
|
||||
EntityHuman entityhuman = itemactioncontext.getEntity();
|
||||
BlockPosition blockposition = itemactioncontext.getClickPosition();
|
||||
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getWorld(), blockposition, false);
|
||||
@@ -121,12 +158,153 @@
|
||||
@@ -160,12 +212,153 @@
|
||||
if (entityhuman != null && !entityhuman.abilities.mayBuild && !this.b(itemactioncontext.getWorld().p(), shapedetectorblock)) {
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
@@ -231,7 +246,7 @@
|
||||
+
|
||||
+ // SPIGOT-1288 - play sound stripped from ItemBlock
|
||||
+ if (this.item instanceof ItemBlock) {
|
||||
+ SoundEffectType soundeffecttype = ((ItemBlock) this.item).getBlock().stepSound;
|
||||
+ SoundEffectType soundeffecttype = ((ItemBlock) this.item).getBlock().getStepSound(null);
|
||||
+ world.playSound(entityhuman, blockposition, soundeffecttype.getPlaceSound(), SoundCategory.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
|
||||
+ }
|
||||
+
|
||||
@@ -244,7 +259,7 @@
|
||||
|
||||
return enuminteractionresult;
|
||||
}
|
||||
@@ -207,6 +385,21 @@
|
||||
@@ -246,6 +439,21 @@
|
||||
}
|
||||
|
||||
i -= k;
|
||||
@@ -266,7 +281,7 @@
|
||||
if (i <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -228,6 +421,11 @@
|
||||
@@ -267,6 +475,11 @@
|
||||
if (this.isDamaged(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
||||
consumer.accept(t0);
|
||||
Item item = this.getItem();
|
||||
@@ -278,7 +293,7 @@
|
||||
|
||||
this.subtract(1);
|
||||
if (t0 instanceof EntityHuman) {
|
||||
@@ -359,6 +557,17 @@
|
||||
@@ -398,6 +611,17 @@
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
@@ -296,7 +311,7 @@
|
||||
public NBTTagCompound getOrCreateTag() {
|
||||
if (this.tag == null) {
|
||||
this.setTag(new NBTTagCompound());
|
||||
@@ -522,6 +731,12 @@
|
||||
@@ -561,6 +785,12 @@
|
||||
}
|
||||
|
||||
public void setRepairCost(int i) {
|
||||
@@ -309,7 +324,7 @@
|
||||
this.getOrCreateTag().setInt("RepairCost", i);
|
||||
}
|
||||
|
||||
@@ -571,6 +786,13 @@
|
||||
@@ -610,6 +840,13 @@
|
||||
nbttaglist.add(nbttagcompound);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemTrident.java
|
||||
+++ b/net/minecraft/server/ItemTrident.java
|
||||
@@ -43,9 +43,12 @@
|
||||
--- a/net/minecraft/world/item/ItemTrident.java
|
||||
+++ b/net/minecraft/world/item/ItemTrident.java
|
||||
@@ -65,9 +65,12 @@
|
||||
|
||||
if (k <= 0 || entityhuman.isInWaterOrRain()) {
|
||||
if (!world.isClientSide) {
|
||||
@@ -13,15 +13,15 @@
|
||||
if (k == 0) {
|
||||
EntityThrownTrident entitythrowntrident = new EntityThrownTrident(world, entityhuman, itemstack);
|
||||
|
||||
@@ -54,16 +57,39 @@
|
||||
@@ -76,16 +79,39 @@
|
||||
entitythrowntrident.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
|
||||
}
|
||||
|
||||
- world.addEntity(entitythrowntrident);
|
||||
+ // CraftBukkit start
|
||||
+ if (!world.addEntity(entitythrowntrident)) {
|
||||
+ if (entityhuman instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/ItemWorldMap.java
|
||||
+++ b/net/minecraft/server/ItemWorldMap.java
|
||||
@@ -6,6 +6,11 @@
|
||||
import com.google.common.collect.Multisets;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/item/ItemWorldMap.java
|
||||
+++ b/net/minecraft/world/item/ItemWorldMap.java
|
||||
@@ -30,6 +30,11 @@
|
||||
import net.minecraft.world.level.material.MaterialMapColor;
|
||||
import net.minecraft.world.level.saveddata.maps.WorldMap;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.Bukkit;
|
||||
@@ -12,7 +12,7 @@
|
||||
public class ItemWorldMap extends ItemWorldMapBase {
|
||||
|
||||
public ItemWorldMap(Item.Info item_info) {
|
||||
@@ -38,7 +43,7 @@
|
||||
@@ -62,7 +67,7 @@
|
||||
public static int d(ItemStack itemstack) {
|
||||
NBTTagCompound nbttagcompound = itemstack.getTag();
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
private static WorldMap a(ItemStack itemstack, World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
||||
@@ -48,6 +53,11 @@
|
||||
@@ -72,6 +77,11 @@
|
||||
worldmap.a(i, j, k, flag, flag1, resourcekey);
|
||||
world.a(worldmap);
|
||||
itemstack.getOrCreateTag().setInt("map", l);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/CraftingManager.java
|
||||
+++ b/net/minecraft/server/CraftingManager.java
|
||||
@@ -23,11 +23,13 @@
|
||||
--- a/net/minecraft/world/item/crafting/CraftingManager.java
|
||||
+++ b/net/minecraft/world/item/crafting/CraftingManager.java
|
||||
@@ -34,11 +34,13 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
private boolean d;
|
||||
|
||||
public CraftingManager() {
|
||||
@@ -36,7 +38,12 @@
|
||||
@@ -47,7 +49,12 @@
|
||||
|
||||
protected void a(Map<MinecraftKey, JsonElement> map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) {
|
||||
this.d = false;
|
||||
@@ -29,7 +29,7 @@
|
||||
Iterator iterator = map.entrySet().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -46,24 +53,42 @@
|
||||
@@ -57,24 +64,42 @@
|
||||
try {
|
||||
IRecipe<?> irecipe = a(minecraftkey, ChatDeserializer.m((JsonElement) entry.getValue(), "top element"));
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
public <C extends IInventory, T extends IRecipe<C>> List<T> a(Recipes<T> recipes) {
|
||||
@@ -81,7 +106,7 @@
|
||||
@@ -92,7 +117,7 @@
|
||||
}
|
||||
|
||||
private <C extends IInventory, T extends IRecipe<C>> Map<MinecraftKey, IRecipe<C>> b(Recipes<T> recipes) {
|
||||
@@ -86,7 +86,7 @@
|
||||
}
|
||||
|
||||
public <C extends IInventory, T extends IRecipe<C>> NonNullList<ItemStack> c(Recipes<T> recipes, C c0, World world) {
|
||||
@@ -102,7 +127,7 @@
|
||||
@@ -113,7 +138,7 @@
|
||||
|
||||
public Optional<? extends IRecipe<?>> getRecipe(MinecraftKey minecraftkey) {
|
||||
return this.recipes.values().stream().map((map) -> {
|
||||
@@ -95,7 +95,7 @@
|
||||
}).filter(Objects::nonNull).findFirst();
|
||||
}
|
||||
|
||||
@@ -125,4 +150,14 @@
|
||||
@@ -136,4 +161,14 @@
|
||||
return new JsonSyntaxException("Invalid or unsupported recipe type '" + s + "'");
|
||||
})).a(minecraftkey, jsonobject);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/FurnaceRecipe.java
|
||||
+++ b/net/minecraft/server/FurnaceRecipe.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/crafting/FurnaceRecipe.java
|
||||
+++ b/net/minecraft/world/item/crafting/FurnaceRecipe.java
|
||||
@@ -3,6 +3,14 @@
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe;
|
||||
@@ -14,7 +15,7 @@
|
||||
public class FurnaceRecipe extends RecipeCooking {
|
||||
|
||||
public FurnaceRecipe(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -10,4 +18,14 @@
|
||||
@@ -13,4 +21,14 @@
|
||||
public RecipeSerializer<?> getRecipeSerializer() {
|
||||
return RecipeSerializer.p;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/IRecipe.java
|
||||
+++ b/net/minecraft/server/IRecipe.java
|
||||
@@ -35,4 +35,6 @@
|
||||
--- a/net/minecraft/world/item/crafting/IRecipe.java
|
||||
+++ b/net/minecraft/world/item/crafting/IRecipe.java
|
||||
@@ -42,4 +42,6 @@
|
||||
RecipeSerializer<?> getRecipeSerializer();
|
||||
|
||||
Recipes<?> g();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/IRecipeComplex.java
|
||||
+++ b/net/minecraft/server/IRecipeComplex.java
|
||||
@@ -22,4 +22,11 @@
|
||||
--- a/net/minecraft/world/item/crafting/IRecipeComplex.java
|
||||
+++ b/net/minecraft/world/item/crafting/IRecipeComplex.java
|
||||
@@ -25,4 +25,11 @@
|
||||
public ItemStack getResult() {
|
||||
return ItemStack.b;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/RecipeBlasting.java
|
||||
+++ b/net/minecraft/server/RecipeBlasting.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/crafting/RecipeBlasting.java
|
||||
+++ b/net/minecraft/world/item/crafting/RecipeBlasting.java
|
||||
@@ -3,6 +3,14 @@
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftBlastingRecipe;
|
||||
@@ -14,7 +15,7 @@
|
||||
public class RecipeBlasting extends RecipeCooking {
|
||||
|
||||
public RecipeBlasting(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -10,4 +18,16 @@
|
||||
@@ -13,4 +21,16 @@
|
||||
public RecipeSerializer<?> getRecipeSerializer() {
|
||||
return RecipeSerializer.q;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/RecipeCampfire.java
|
||||
+++ b/net/minecraft/server/RecipeCampfire.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/crafting/RecipeCampfire.java
|
||||
+++ b/net/minecraft/world/item/crafting/RecipeCampfire.java
|
||||
@@ -3,6 +3,14 @@
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftCampfireRecipe;
|
||||
@@ -14,7 +15,7 @@
|
||||
public class RecipeCampfire extends RecipeCooking {
|
||||
|
||||
public RecipeCampfire(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -10,4 +18,16 @@
|
||||
@@ -13,4 +21,16 @@
|
||||
public RecipeSerializer<?> getRecipeSerializer() {
|
||||
return RecipeSerializer.s;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/RecipeItemStack.java
|
||||
+++ b/net/minecraft/server/RecipeItemStack.java
|
||||
@@ -25,6 +25,7 @@
|
||||
--- a/net/minecraft/world/item/crafting/RecipeItemStack.java
|
||||
+++ b/net/minecraft/world/item/crafting/RecipeItemStack.java
|
||||
@@ -35,6 +35,7 @@
|
||||
private final RecipeItemStack.Provider[] b;
|
||||
public ItemStack[] choices;
|
||||
private IntList d;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public RecipeItemStack(Stream<? extends RecipeItemStack.Provider> stream) {
|
||||
this.b = (RecipeItemStack.Provider[]) stream.toArray((i) -> {
|
||||
@@ -57,6 +58,15 @@
|
||||
@@ -67,6 +68,15 @@
|
||||
for (int j = 0; j < i; ++j) {
|
||||
ItemStack itemstack1 = aitemstack[j];
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/RecipeSmithing.java
|
||||
+++ b/net/minecraft/server/RecipeSmithing.java
|
||||
@@ -3,6 +3,14 @@
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
--- a/net/minecraft/world/item/crafting/RecipeSmithing.java
|
||||
+++ b/net/minecraft/world/item/crafting/RecipeSmithing.java
|
||||
@@ -10,6 +10,14 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -15,7 +15,7 @@
|
||||
public class RecipeSmithing implements IRecipe<IInventory> {
|
||||
|
||||
private final RecipeItemStack a;
|
||||
@@ -58,6 +66,17 @@
|
||||
@@ -65,6 +73,17 @@
|
||||
return Recipes.SMITHING;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/RecipeSmoking.java
|
||||
+++ b/net/minecraft/server/RecipeSmoking.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/crafting/RecipeSmoking.java
|
||||
+++ b/net/minecraft/world/item/crafting/RecipeSmoking.java
|
||||
@@ -3,6 +3,14 @@
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -14,7 +15,7 @@
|
||||
public class RecipeSmoking extends RecipeCooking {
|
||||
|
||||
public RecipeSmoking(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -10,4 +18,16 @@
|
||||
@@ -13,4 +21,16 @@
|
||||
public RecipeSerializer<?> getRecipeSerializer() {
|
||||
return RecipeSerializer.r;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/RecipeStonecutting.java
|
||||
+++ b/net/minecraft/server/RecipeStonecutting.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/crafting/RecipeStonecutting.java
|
||||
+++ b/net/minecraft/world/item/crafting/RecipeStonecutting.java
|
||||
@@ -5,6 +5,14 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -14,7 +15,7 @@
|
||||
public class RecipeStonecutting extends RecipeSingleItem {
|
||||
|
||||
public RecipeStonecutting(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack) {
|
||||
@@ -10,4 +18,16 @@
|
||||
@@ -15,4 +23,16 @@
|
||||
public boolean a(IInventory iinventory, World world) {
|
||||
return this.ingredient.test(iinventory.getItem(0));
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/ShapedRecipes.java
|
||||
+++ b/net/minecraft/server/ShapedRecipes.java
|
||||
@@ -13,6 +13,13 @@
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
--- a/net/minecraft/world/item/crafting/ShapedRecipes.java
|
||||
+++ b/net/minecraft/world/item/crafting/ShapedRecipes.java
|
||||
@@ -22,6 +22,13 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -14,7 +14,7 @@
|
||||
public class ShapedRecipes implements RecipeCrafting {
|
||||
|
||||
private final int width;
|
||||
@@ -31,6 +38,66 @@
|
||||
@@ -40,6 +47,66 @@
|
||||
this.result = itemstack;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/ShapelessRecipes.java
|
||||
+++ b/net/minecraft/server/ShapelessRecipes.java
|
||||
@@ -6,6 +6,12 @@
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import java.util.Iterator;
|
||||
--- a/net/minecraft/world/item/crafting/ShapelessRecipes.java
|
||||
+++ b/net/minecraft/world/item/crafting/ShapelessRecipes.java
|
||||
@@ -14,6 +14,12 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class ShapelessRecipes implements RecipeCrafting {
|
||||
|
||||
private final MinecraftKey key;
|
||||
@@ -20,6 +26,20 @@
|
||||
@@ -28,6 +34,20 @@
|
||||
this.ingredients = nonnulllist;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EnchantmentFrostWalker.java
|
||||
+++ b/net/minecraft/server/EnchantmentFrostWalker.java
|
||||
@@ -46,8 +46,11 @@
|
||||
--- a/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.java
|
||||
+++ b/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.java
|
||||
@@ -57,8 +57,11 @@
|
||||
IBlockData iblockdata2 = world.getType(blockposition1);
|
||||
|
||||
if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EnchantmentWeaponDamage.java
|
||||
+++ b/net/minecraft/server/EnchantmentWeaponDamage.java
|
||||
@@ -51,7 +51,7 @@
|
||||
--- a/net/minecraft/world/item/enchantment/EnchantmentWeaponDamage.java
|
||||
+++ b/net/minecraft/world/item/enchantment/EnchantmentWeaponDamage.java
|
||||
@@ -60,7 +60,7 @@
|
||||
if (this.a == 2 && entityliving1.getMonsterType() == EnumMonsterType.ARTHROPOD) {
|
||||
int j = 20 + entityliving.getRandom().nextInt(10 * i);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/Enchantments.java
|
||||
+++ b/net/minecraft/server/Enchantments.java
|
||||
@@ -42,7 +42,15 @@
|
||||
--- a/net/minecraft/world/item/enchantment/Enchantments.java
|
||||
+++ b/net/minecraft/world/item/enchantment/Enchantments.java
|
||||
@@ -45,7 +45,15 @@
|
||||
public static final Enchantment MENDING = a("mending", new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
|
||||
public static final Enchantment VANISHING_CURSE = a("vanishing_curse", new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values()));
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/IMerchant.java
|
||||
+++ b/net/minecraft/server/IMerchant.java
|
||||
@@ -44,4 +44,6 @@
|
||||
--- a/net/minecraft/world/item/trading/IMerchant.java
|
||||
+++ b/net/minecraft/world/item/trading/IMerchant.java
|
||||
@@ -51,4 +51,6 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
--- a/net/minecraft/server/MerchantRecipe.java
|
||||
+++ b/net/minecraft/server/MerchantRecipe.java
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/item/trading/MerchantRecipe.java
|
||||
+++ b/net/minecraft/world/item/trading/MerchantRecipe.java
|
||||
@@ -5,6 +5,8 @@
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
+import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; // CraftBukkit
|
||||
+
|
||||
public class MerchantRecipe {
|
||||
|
||||
public ItemStack buyingItem1;
|
||||
@@ -12,6 +14,18 @@
|
||||
@@ -17,6 +19,18 @@
|
||||
private int demand;
|
||||
public float priceMultiplier;
|
||||
public int xp;
|
||||
@@ -27,7 +28,7 @@
|
||||
|
||||
public MerchantRecipe(NBTTagCompound nbttagcompound) {
|
||||
this.rewardExp = true;
|
||||
@@ -73,6 +87,7 @@
|
||||
@@ -78,6 +92,7 @@
|
||||
|
||||
public ItemStack getBuyItem1() {
|
||||
int i = this.buyingItem1.getCount();
|
||||
|
||||
Reference in New Issue
Block a user