@@ -27,7 +27,7 @@
|
||||
+
|
||||
if (i == 0) {
|
||||
this.onOpen(world, blockposition, iblockdata);
|
||||
world.gameEvent(entityhuman, GameEvent.CONTAINER_OPEN, blockposition);
|
||||
world.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_OPEN, blockposition);
|
||||
@@ -37,8 +49,19 @@
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
+
|
||||
if (this.openCount == 0) {
|
||||
this.onClose(world, blockposition, iblockdata);
|
||||
world.gameEvent(entityhuman, GameEvent.CONTAINER_CLOSE, blockposition);
|
||||
world.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_CLOSE, blockposition);
|
||||
@@ -59,6 +82,7 @@
|
||||
|
||||
public void recheckOpeners(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBanner.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBanner.java
|
||||
@@ -101,6 +101,11 @@
|
||||
@@ -102,6 +102,11 @@
|
||||
}
|
||||
|
||||
this.itemPatterns = nbttagcompound.getList("Patterns", 10);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBarrel.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBarrel.java
|
||||
@@ -21,8 +21,49 @@
|
||||
@@ -20,8 +20,49 @@
|
||||
import net.minecraft.world.level.block.BlockBarrel;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
@@ -38,6 +38,11 @@
|
||||
@@ -37,6 +37,11 @@
|
||||
import net.minecraft.world.level.levelgen.HeightMap;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class TileEntityBeacon extends TileEntity implements ITileInventory {
|
||||
|
||||
private static final int MAX_LEVELS = 4;
|
||||
@@ -60,6 +65,15 @@
|
||||
@@ -59,6 +64,15 @@
|
||||
public IChatBaseComponent name;
|
||||
public ChestLock lockKey;
|
||||
private final IContainerProperties dataAccess;
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
public TileEntityBeacon(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BEACON, blockposition, iblockdata);
|
||||
@@ -228,39 +242,78 @@
|
||||
@@ -234,39 +248,78 @@
|
||||
super.setRemoved();
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
public static void playSound(World world, BlockPosition blockposition, SoundEffect soundeffect) {
|
||||
world.playSound((EntityHuman) null, blockposition, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -289,8 +342,11 @@
|
||||
@@ -295,8 +348,11 @@
|
||||
@Override
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
super.load(nbttagcompound);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
@@ -42,6 +42,7 @@
|
||||
@@ -43,6 +43,7 @@
|
||||
private final List<TileEntityBeehive.HiveBee> stored = Lists.newArrayList();
|
||||
@Nullable
|
||||
public BlockPosition savedFlowerPos;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public TileEntityBeehive(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BEEHIVE, blockposition, iblockdata);
|
||||
@@ -81,7 +82,7 @@
|
||||
@@ -82,7 +83,7 @@
|
||||
}
|
||||
|
||||
public boolean isFull() {
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
|
||||
public void emptyAllLivingFromHive(@Nullable EntityHuman entityhuman, IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
|
||||
@@ -98,7 +99,7 @@
|
||||
@@ -99,7 +100,7 @@
|
||||
|
||||
if (entityhuman.position().distanceToSqr(entity.position()) <= 16.0D) {
|
||||
if (!this.isSedated()) {
|
||||
@@ -26,7 +26,7 @@
|
||||
} else {
|
||||
entitybee.setStayOutOfHiveCountdown(400);
|
||||
}
|
||||
@@ -110,10 +111,16 @@
|
||||
@@ -111,10 +112,16 @@
|
||||
}
|
||||
|
||||
private List<Entity> releaseAllOccupants(IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
|
||||
@@ -44,7 +44,7 @@
|
||||
});
|
||||
if (!list.isEmpty()) {
|
||||
super.setChanged();
|
||||
@@ -141,7 +148,19 @@
|
||||
@@ -142,7 +149,19 @@
|
||||
}
|
||||
|
||||
public void addOccupantWithPresetTicks(Entity entity, boolean flag, int i) {
|
||||
@@ -65,7 +65,7 @@
|
||||
entity.stopRiding();
|
||||
entity.ejectPassengers();
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
@@ -172,7 +191,13 @@
|
||||
@@ -174,7 +193,13 @@
|
||||
}
|
||||
|
||||
private static boolean releaseOccupant(World world, BlockPosition blockposition, IBlockData iblockdata, TileEntityBeehive.HiveBee tileentitybeehive_hivebee, @Nullable List<Entity> list, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus, @Nullable BlockPosition blockposition1) {
|
||||
@@ -80,7 +80,7 @@
|
||||
return false;
|
||||
} else {
|
||||
NBTTagCompound nbttagcompound = tileentitybeehive_hivebee.entityData.copy();
|
||||
@@ -195,6 +220,18 @@
|
||||
@@ -197,6 +222,18 @@
|
||||
if (!entity.getType().is(TagsEntity.BEEHIVE_INHABITORS)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -99,7 +99,7 @@
|
||||
if (entity instanceof EntityBee) {
|
||||
EntityBee entitybee = (EntityBee) entity;
|
||||
|
||||
@@ -226,6 +263,7 @@
|
||||
@@ -228,6 +265,7 @@
|
||||
list.add(entitybee);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
float f = entity.getBbWidth();
|
||||
double d0 = flag ? 0.0D : 0.55D + (double) (f / 2.0F);
|
||||
double d1 = (double) blockposition.getX() + 0.5D + d0 * (double) enumdirection.getStepX();
|
||||
@@ -233,10 +271,11 @@
|
||||
@@ -235,11 +273,12 @@
|
||||
double d3 = (double) blockposition.getZ() + 0.5D + d0 * (double) enumdirection.getStepZ();
|
||||
|
||||
entity.moveTo(d1, d2, d3, entity.getYRot(), entity.getXRot());
|
||||
@@ -115,12 +115,13 @@
|
||||
}
|
||||
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.BEEHIVE_EXIT, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(entity, world.getBlockState(blockposition)));
|
||||
- return world.addFreshEntity(entity);
|
||||
+ return true; // return this.world.addFreshEntity(entity); // CraftBukkit - moved up
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
@@ -285,6 +324,10 @@
|
||||
@@ -288,6 +327,10 @@
|
||||
if (releaseOccupant(world, blockposition, iblockdata, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus, blockposition1)) {
|
||||
flag = true;
|
||||
iterator.remove();
|
||||
@@ -131,7 +132,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,6 +369,11 @@
|
||||
@@ -329,6 +372,11 @@
|
||||
this.savedFlowerPos = GameProfileSerializer.readBlockPos(nbttagcompound.getCompound("FlowerPos"));
|
||||
}
|
||||
|
||||
@@ -143,7 +144,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -335,6 +383,7 @@
|
||||
@@ -338,6 +386,7 @@
|
||||
if (this.hasSavedFlowerPos()) {
|
||||
nbttagcompound.put("FlowerPos", GameProfileSerializer.writeBlockPos(this.savedFlowerPos));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
|
||||
@@ -25,6 +25,19 @@
|
||||
@@ -24,6 +24,19 @@
|
||||
import net.minecraft.world.level.block.BlockBrewingStand;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
public class TileEntityBrewingStand extends TileEntityContainer implements IWorldInventory {
|
||||
|
||||
private static final int INGREDIENT_SLOT = 3;
|
||||
@@ -42,6 +55,36 @@
|
||||
@@ -41,6 +54,36 @@
|
||||
private Item ingredient;
|
||||
public int fuel;
|
||||
protected final IContainerProperties dataAccess;
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
public TileEntityBrewingStand(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BREWING_STAND, blockposition, iblockdata);
|
||||
@@ -109,8 +152,19 @@
|
||||
@@ -108,8 +151,19 @@
|
||||
ItemStack itemstack = (ItemStack) tileentitybrewingstand.items.get(4);
|
||||
|
||||
if (tileentitybrewingstand.fuel <= 0 && itemstack.is(Items.BLAZE_POWDER)) {
|
||||
@@ -79,7 +79,7 @@
|
||||
setChanged(world, blockposition, iblockdata);
|
||||
}
|
||||
|
||||
@@ -118,12 +172,17 @@
|
||||
@@ -117,12 +171,17 @@
|
||||
boolean flag1 = tileentitybrewingstand.brewTime > 0;
|
||||
ItemStack itemstack1 = (ItemStack) tileentitybrewingstand.items.get(3);
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
setChanged(world, blockposition, iblockdata);
|
||||
} else if (!flag || !itemstack1.is(tileentitybrewingstand.ingredient)) {
|
||||
tileentitybrewingstand.brewTime = 0;
|
||||
@@ -187,11 +246,33 @@
|
||||
@@ -186,11 +245,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
||||
@@ -20,6 +20,12 @@
|
||||
import net.minecraft.world.level.block.BlockCampfire;
|
||||
@@ -25,6 +25,12 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class TileEntityCampfire extends TileEntity implements Clearable {
|
||||
|
||||
private static final int BURN_COOL_SPEED = 2;
|
||||
@@ -51,6 +57,20 @@
|
||||
@@ -58,6 +64,20 @@
|
||||
return recipecampfire.assemble(inventorysubcontainer);
|
||||
}).orElse(itemstack);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityChest.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityChest.java
|
||||
@@ -24,6 +24,12 @@
|
||||
@@ -23,6 +23,12 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.block.state.properties.BlockPropertyChestType;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class TileEntityChest extends TileEntityLootable implements LidBlockEntity {
|
||||
|
||||
private static final int EVENT_SET_OPEN_COUNT = 1;
|
||||
@@ -31,6 +37,36 @@
|
||||
@@ -30,6 +36,36 @@
|
||||
public final ContainerOpenersCounter openersCounter;
|
||||
private final ChestLidController chestLidController;
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
protected TileEntityChest(TileEntityTypes<?> tileentitytypes, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(tileentitytypes, blockposition, iblockdata);
|
||||
this.items = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
@@ -199,4 +235,11 @@
|
||||
@@ -198,4 +234,11 @@
|
||||
|
||||
world.blockEvent(blockposition, block, 1, j);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityContainer.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityContainer.java
|
||||
@@ -89,4 +89,12 @@
|
||||
@@ -88,4 +88,12 @@
|
||||
}
|
||||
|
||||
protected abstract Container createMenu(int i, PlayerInventory playerinventory);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityDispenser.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityDispenser.java
|
||||
@@ -14,12 +14,48 @@
|
||||
@@ -13,11 +13,47 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
+
|
||||
public class TileEntityDispenser extends TileEntityLootable {
|
||||
|
||||
private static final Random RANDOM = new Random();
|
||||
public static final int CONTAINER_SIZE = 9;
|
||||
private NonNullList<ItemStack> items;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityFurnace.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityFurnace.java
|
||||
@@ -45,6 +45,20 @@
|
||||
@@ -46,6 +46,20 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -21,7 +21,16 @@
|
||||
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput {
|
||||
|
||||
protected static final int SLOT_INPUT = 0;
|
||||
@@ -184,6 +198,40 @@
|
||||
@@ -114,7 +128,7 @@
|
||||
}
|
||||
};
|
||||
this.recipesUsed = new Object2IntOpenHashMap();
|
||||
- this.quickCheck = CraftingManager.createCheck(recipes);
|
||||
+ this.quickCheck = CraftingManager.createCheck((Recipes<RecipeCooking>) recipes); // CraftBukkit - decompile error // Eclipse fail
|
||||
}
|
||||
|
||||
public static Map<Item, Integer> getFuel() {
|
||||
@@ -188,6 +202,40 @@
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -62,12 +71,16 @@
|
||||
private static boolean isNeverAFurnaceFuel(Item item) {
|
||||
return item.builtInRegistryHolder().is(TagsItem.NON_FLAMMABLE_WOOD);
|
||||
}
|
||||
@@ -267,13 +315,24 @@
|
||||
tileentityfurnace.cookingProgress = MathHelper.clamp(tileentityfurnace.cookingProgress - 2, (int) 0, tileentityfurnace.cookingTotalTime);
|
||||
@@ -276,7 +324,7 @@
|
||||
IRecipe irecipe;
|
||||
|
||||
if (flag2) {
|
||||
- irecipe = (IRecipe) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse((Object) null);
|
||||
+ irecipe = (IRecipe) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error
|
||||
} else {
|
||||
irecipe = null;
|
||||
}
|
||||
} else {
|
||||
- IRecipe<?> irecipe = (IRecipe) world.getRecipeManager().getRecipeFor(tileentityfurnace.recipeType, tileentityfurnace, world).orElse((Object) null);
|
||||
+ IRecipe<?> irecipe = (IRecipe) world.getRecipeManager().getRecipeFor((Recipes<RecipeCooking>) tileentityfurnace.recipeType, tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error // Eclipse fail
|
||||
@@ -284,9 +332,20 @@
|
||||
int i = tileentityfurnace.getMaxStackSize();
|
||||
|
||||
if (!tileentityfurnace.isLit() && canBurn(irecipe, tileentityfurnace.items, i)) {
|
||||
@@ -88,9 +101,9 @@
|
||||
+ if (tileentityfurnace.isLit() && furnaceBurnEvent.isBurning()) {
|
||||
+ // CraftBukkit end
|
||||
flag1 = true;
|
||||
if (!itemstack.isEmpty()) {
|
||||
if (flag3) {
|
||||
Item item = itemstack.getItem();
|
||||
@@ -289,11 +348,23 @@
|
||||
@@ -302,11 +361,23 @@
|
||||
}
|
||||
|
||||
if (tileentityfurnace.isLit() && canBurn(irecipe, tileentityfurnace.items, i)) {
|
||||
@@ -109,13 +122,13 @@
|
||||
++tileentityfurnace.cookingProgress;
|
||||
if (tileentityfurnace.cookingProgress == tileentityfurnace.cookingTotalTime) {
|
||||
tileentityfurnace.cookingProgress = 0;
|
||||
tileentityfurnace.cookingTotalTime = getTotalCookTime(world, tileentityfurnace.recipeType, tileentityfurnace);
|
||||
tileentityfurnace.cookingTotalTime = getTotalCookTime(world, tileentityfurnace);
|
||||
- if (burn(irecipe, tileentityfurnace.items, i)) {
|
||||
+ if (burn(tileentityfurnace.level, tileentityfurnace.worldPosition, irecipe, tileentityfurnace.items, i)) { // CraftBukkit
|
||||
tileentityfurnace.setRecipeUsed(irecipe);
|
||||
}
|
||||
|
||||
@@ -332,17 +403,44 @@
|
||||
@@ -345,17 +416,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,16 +174,16 @@
|
||||
|
||||
if (itemstack.is(Blocks.WET_SPONGE.asItem()) && !((ItemStack) nonnulllist.get(1)).isEmpty() && ((ItemStack) nonnulllist.get(1)).is(Items.BUCKET)) {
|
||||
nonnulllist.set(1, new ItemStack(Items.WATER_BUCKET));
|
||||
@@ -366,7 +464,7 @@
|
||||
@@ -379,7 +477,7 @@
|
||||
}
|
||||
|
||||
private static int getTotalCookTime(World world, Recipes<? extends RecipeCooking> recipes, IInventory iinventory) {
|
||||
- return (Integer) world.getRecipeManager().getRecipeFor(recipes, iinventory, world).map(RecipeCooking::getCookingTime).orElse(200);
|
||||
+ return (world != null) ? (Integer) world.getRecipeManager().getRecipeFor((Recipes<RecipeCooking>) recipes, iinventory, world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302 // Eclipse fail
|
||||
private static int getTotalCookTime(World world, TileEntityFurnace tileentityfurnace) {
|
||||
- return (Integer) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).map(RecipeCooking::getCookingTime).orElse(200);
|
||||
+ return (world != null) ? (Integer) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302
|
||||
}
|
||||
|
||||
public static boolean isFuel(ItemStack itemstack) {
|
||||
@@ -485,14 +583,20 @@
|
||||
@@ -498,14 +596,20 @@
|
||||
@Override
|
||||
public void awardUsedRecipes(EntityHuman entityhuman) {}
|
||||
|
||||
@@ -193,7 +206,7 @@
|
||||
List<IRecipe<?>> list = Lists.newArrayList();
|
||||
ObjectIterator objectiterator = this.recipesUsed.object2IntEntrySet().iterator();
|
||||
|
||||
@@ -501,14 +605,14 @@
|
||||
@@ -514,14 +618,14 @@
|
||||
|
||||
worldserver.getRecipeManager().byKey((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
|
||||
list.add(irecipe);
|
||||
@@ -210,7 +223,7 @@
|
||||
int j = MathHelper.floor((float) i * f);
|
||||
float f1 = MathHelper.frac((float) i * f);
|
||||
|
||||
@@ -516,6 +620,17 @@
|
||||
@@ -529,6 +633,17 @@
|
||||
++j;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityHopper.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityHopper.java
|
||||
@@ -33,6 +33,18 @@
|
||||
@@ -32,6 +32,18 @@
|
||||
import net.minecraft.world.phys.shapes.OperatorBoolean;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
public class TileEntityHopper extends TileEntityLootable implements IHopper {
|
||||
|
||||
public static final int MOVE_ITEM_SPEED = 8;
|
||||
@@ -41,6 +53,36 @@
|
||||
@@ -40,6 +52,36 @@
|
||||
private int cooldownTime;
|
||||
private long tickedGameTime;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
public TileEntityHopper(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.HOPPER, blockposition, iblockdata);
|
||||
this.items = NonNullList.withSize(5, ItemStack.EMPTY);
|
||||
@@ -114,7 +156,7 @@
|
||||
@@ -113,7 +155,7 @@
|
||||
boolean flag = false;
|
||||
|
||||
if (!tileentityhopper.isEmpty()) {
|
||||
@@ -65,7 +65,7 @@
|
||||
}
|
||||
|
||||
if (!tileentityhopper.inventoryFull()) {
|
||||
@@ -148,7 +190,7 @@
|
||||
@@ -147,7 +189,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
IInventory iinventory1 = getAttachedContainer(world, blockposition, iblockdata);
|
||||
|
||||
if (iinventory1 == null) {
|
||||
@@ -162,7 +204,28 @@
|
||||
@@ -161,7 +203,28 @@
|
||||
for (int i = 0; i < iinventory.getContainerSize(); ++i) {
|
||||
if (!iinventory.getItem(i).isEmpty()) {
|
||||
ItemStack itemstack = iinventory.getItem(i).copy();
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
iinventory1.setChanged();
|
||||
@@ -227,7 +290,34 @@
|
||||
@@ -226,7 +289,34 @@
|
||||
|
||||
if (!itemstack.isEmpty() && canTakeItemFromContainer(iinventory, itemstack, i, enumdirection)) {
|
||||
ItemStack itemstack1 = itemstack.copy();
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
if (itemstack2.isEmpty()) {
|
||||
iinventory.setChanged();
|
||||
@@ -242,6 +332,13 @@
|
||||
@@ -241,6 +331,13 @@
|
||||
|
||||
public static boolean addItem(IInventory iinventory, EntityItem entityitem) {
|
||||
boolean flag = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityLectern.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityLectern.java
|
||||
@@ -26,13 +26,71 @@
|
||||
@@ -24,13 +24,71 @@
|
||||
import net.minecraft.world.phys.Vec2F;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
@Override
|
||||
public int getContainerSize() {
|
||||
return 1;
|
||||
@@ -77,11 +135,20 @@
|
||||
@@ -75,11 +133,20 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,7 +228,7 @@
|
||||
@@ -159,7 +226,7 @@
|
||||
if (j != this.page) {
|
||||
this.page = j;
|
||||
this.setChanged();
|
||||
@@ -106,13 +106,13 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -184,6 +251,32 @@
|
||||
@@ -182,6 +249,32 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) {
|
||||
+ public void sendSystemMessage(IChatBaseComponent ichatbasecomponent) {
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -139,7 +139,7 @@
|
||||
private CommandListenerWrapper createCommandSourceStack(@Nullable EntityHuman entityhuman) {
|
||||
String s;
|
||||
Object object;
|
||||
@@ -198,7 +291,8 @@
|
||||
@@ -196,7 +289,8 @@
|
||||
|
||||
Vec3D vec3d = Vec3D.atCenterOf(this.worldPosition);
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -236,7 +330,7 @@
|
||||
@@ -234,7 +328,7 @@
|
||||
|
||||
@Override
|
||||
public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
|
||||
@@ -32,6 +32,11 @@
|
||||
@@ -31,6 +31,11 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory {
|
||||
|
||||
public static final int COLUMNS = 9;
|
||||
@@ -51,6 +56,37 @@
|
||||
@@ -50,6 +55,37 @@
|
||||
@Nullable
|
||||
private final EnumColor color;
|
||||
|
||||
@@ -50,19 +50,19 @@
|
||||
public TileEntityShulkerBox(@Nullable EnumColor enumcolor, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.SHULKER_BOX, blockposition, iblockdata);
|
||||
this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
@@ -163,6 +199,7 @@
|
||||
@@ -162,6 +198,7 @@
|
||||
}
|
||||
|
||||
++this.openCount;
|
||||
+ if (opened) return; // CraftBukkit - only animate if the ShulkerBox hasn't been forced open already by an API call.
|
||||
this.level.blockEvent(this.worldPosition, this.getBlockState().getBlock(), 1, this.openCount);
|
||||
if (this.openCount == 1) {
|
||||
this.level.gameEvent(entityhuman, GameEvent.CONTAINER_OPEN, this.worldPosition);
|
||||
@@ -176,6 +213,7 @@
|
||||
this.level.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_OPEN, this.worldPosition);
|
||||
@@ -175,6 +212,7 @@
|
||||
public void stopOpen(EntityHuman entityhuman) {
|
||||
if (!entityhuman.isSpectator()) {
|
||||
--this.openCount;
|
||||
+ if (opened) return; // CraftBukkit - only animate if the ShulkerBox hasn't been forced open already by an API call.
|
||||
this.level.blockEvent(this.worldPosition, this.getBlockState().getBlock(), 1, this.openCount);
|
||||
if (this.openCount <= 0) {
|
||||
this.level.gameEvent(entityhuman, GameEvent.CONTAINER_CLOSE, this.worldPosition);
|
||||
this.level.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_CLOSE, this.worldPosition);
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
}
|
||||
+ // CraftBukkit start
|
||||
+ } catch (com.google.gson.JsonParseException jsonparseexception) {
|
||||
+ return new ChatComponentText(s);
|
||||
+ return IChatBaseComponent.empty();
|
||||
+ // CraftBukkit end
|
||||
} catch (Exception exception) {
|
||||
;
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public void sendMessage(IChatBaseComponent ichatbasecomponent, java.util.UUID uuid) {}
|
||||
+ public void sendSystemMessage(IChatBaseComponent ichatbasecomponent) {}
|
||||
+
|
||||
+ @Override
|
||||
+ public org.bukkit.command.CommandSender getBukkitSender(CommandListenerWrapper wrapper) {
|
||||
@@ -89,7 +89,7 @@
|
||||
+
|
||||
public CommandListenerWrapper createCommandSourceStack(@Nullable EntityPlayer entityplayer) {
|
||||
String s = entityplayer == null ? "Sign" : entityplayer.getName().getString();
|
||||
Object object = entityplayer == null ? new ChatComponentText("Sign") : entityplayer.getDisplayName();
|
||||
Object object = entityplayer == null ? IChatBaseComponent.literal("Sign") : entityplayer.getDisplayName();
|
||||
|
||||
- return new CommandListenerWrapper(ICommandListener.NULL, Vec3D.atCenterOf(this.worldPosition), Vec2F.ZERO, (WorldServer) this.level, 2, s, (IChatBaseComponent) object, this.level.getServer(), entityplayer);
|
||||
+ // CraftBukkit - this
|
||||
|
||||
Reference in New Issue
Block a user