Repackage NMS

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 18496e998f
commit 9da047989c
968 changed files with 5448 additions and 5050 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/Block.java
+++ b/net/minecraft/server/Block.java
@@ -209,7 +209,13 @@
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
@@ -248,7 +248,13 @@
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack);
entityitem.defaultPickupDelay();
@@ -15,7 +15,7 @@
}
}
@@ -240,7 +246,7 @@
@@ -279,7 +285,7 @@
public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
entityhuman.b(StatisticList.BLOCK_MINED.b(this));
@@ -24,7 +24,7 @@
dropItems(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
}
@@ -336,6 +342,12 @@
@@ -375,6 +381,12 @@
return this;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockBamboo.java
+++ b/net/minecraft/server/BlockBamboo.java
@@ -170,14 +170,18 @@
--- a/net/minecraft/world/level/block/BlockBamboo.java
+++ b/net/minecraft/world/level/block/BlockBamboo.java
@@ -195,14 +195,18 @@
BlockPosition blockposition1 = blockposition.down(2);
IBlockData iblockdata2 = world.getType(blockposition1);
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
@@ -21,7 +21,7 @@
}
}
} else {
@@ -188,7 +192,14 @@
@@ -213,7 +217,14 @@
int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1;
int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockBambooSapling.java
+++ b/net/minecraft/server/BlockBambooSapling.java
@@ -69,6 +69,6 @@
--- a/net/minecraft/world/level/block/BlockBambooSapling.java
+++ b/net/minecraft/world/level/block/BlockBambooSapling.java
@@ -86,6 +86,6 @@
}
protected void a(World world, BlockPosition blockposition) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockBed.java
+++ b/net/minecraft/server/BlockBed.java
@@ -39,7 +39,8 @@
--- a/net/minecraft/world/level/block/BlockBed.java
+++ b/net/minecraft/world/level/block/BlockBed.java
@@ -78,7 +78,8 @@
}
}
@@ -10,7 +10,7 @@
world.a(blockposition, false);
BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockBed.FACING)).opposite());
@@ -56,7 +57,16 @@
@@ -95,7 +96,16 @@
return EnumInteractionResult.SUCCESS;
} else {
@@ -27,7 +27,7 @@
if (entityhuman_enumbedresult != null) {
entityhuman.a(entityhuman_enumbedresult.a(), true);
}
@@ -67,8 +77,27 @@
@@ -106,8 +116,27 @@
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockBeehive.java
+++ b/net/minecraft/server/BlockBeehive.java
@@ -55,7 +55,7 @@
--- a/net/minecraft/world/level/block/BlockBeehive.java
+++ b/net/minecraft/world/level/block/BlockBeehive.java
@@ -97,7 +97,7 @@
EntityBee entitybee = (EntityBee) iterator.next();
if (entitybee.getGoalTarget() == null) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockButtonAbstract.java
+++ b/net/minecraft/server/BlockButtonAbstract.java
@@ -4,6 +4,11 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockButtonAbstract.java
+++ b/net/minecraft/world/level/block/BlockButtonAbstract.java
@@ -26,6 +26,11 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.event.block.BlockRedstoneEvent;
@@ -12,7 +12,7 @@
public abstract class BlockButtonAbstract extends BlockAttachable {
public static final BlockStateBoolean POWERED = BlockProperties.w;
@@ -70,6 +75,19 @@
@@ -92,6 +97,19 @@
if ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)) {
return EnumInteractionResult.CONSUME;
} else {
@@ -32,7 +32,7 @@
this.d(iblockdata, world, blockposition);
this.a(entityhuman, world, blockposition, true);
return EnumInteractionResult.a(world.isClientSide);
@@ -120,6 +138,16 @@
@@ -142,6 +160,16 @@
if (this.v) {
this.e(iblockdata, (World) worldserver, blockposition);
} else {
@@ -49,7 +49,7 @@
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, false), 3);
this.f(iblockdata, (World) worldserver, blockposition);
this.a((EntityHuman) null, worldserver, blockposition, false);
@@ -140,7 +168,44 @@
@@ -162,7 +190,44 @@
boolean flag = !list.isEmpty();
boolean flag1 = (Boolean) iblockdata.get(BlockButtonAbstract.POWERED);

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockCactus.java
+++ b/net/minecraft/server/BlockCactus.java
@@ -3,6 +3,8 @@
import java.util.Iterator;
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockCactus.java
+++ b/net/minecraft/world/level/block/BlockCactus.java
@@ -23,6 +23,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockCactus extends Block {
public static final BlockStateInteger AGE = BlockProperties.aj;
@@ -37,7 +39,7 @@
@@ -57,7 +59,7 @@
int j = (Integer) iblockdata.get(BlockCactus.AGE);
if (j == 15) {
@@ -18,7 +18,7 @@
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockCactus.AGE, 0);
worldserver.setTypeAndData(blockposition, iblockdata1, 4);
@@ -94,7 +96,9 @@
@@ -114,7 +116,9 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockCake.java
+++ b/net/minecraft/server/BlockCake.java
@@ -37,7 +37,18 @@
--- a/net/minecraft/world/level/block/BlockCake.java
+++ b/net/minecraft/world/level/block/BlockCake.java
@@ -58,7 +58,18 @@
return EnumInteractionResult.PASS;
} else {
entityhuman.a(StatisticList.EAT_CAKE_SLICE);
@@ -15,7 +15,7 @@
+ entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 0.1F);
+ }
+
+ ((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate();
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate();
+ // CraftBukkit end
int i = (Integer) iblockdata.get(BlockCake.BITES);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockCampfire.java
+++ b/net/minecraft/server/BlockCampfire.java
@@ -144,6 +144,11 @@
--- a/net/minecraft/world/level/block/BlockCampfire.java
+++ b/net/minecraft/world/level/block/BlockCampfire.java
@@ -186,6 +186,11 @@
if (flag && !(Boolean) iblockdata.get(BlockCampfire.LIT) && !(Boolean) iblockdata.get(BlockCampfire.d)) {
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();

View File

@@ -1,14 +1,15 @@
--- a/net/minecraft/server/BlockCauldron.java
+++ b/net/minecraft/server/BlockCauldron.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/BlockCauldron.java
+++ b/net/minecraft/world/level/block/BlockCauldron.java
@@ -34,6 +34,8 @@
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
import net.minecraft.world.phys.shapes.VoxelShapes;
+import org.bukkit.event.block.CauldronLevelChangeEvent; // CraftBukkit
+
public class BlockCauldron extends Block {
public static final BlockStateInteger LEVEL = BlockProperties.ar;
@@ -27,8 +29,13 @@
@@ -61,8 +63,13 @@
float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F;
if (!world.isClientSide && entity.isBurning() && i > 0 && entity.locY() <= (double) f) {
@@ -23,7 +24,7 @@
}
}
@@ -45,18 +52,27 @@
@@ -79,18 +86,27 @@
if (item == Items.WATER_BUCKET) {
if (i < 3 && !world.isClientSide) {
@@ -52,7 +53,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack.subtract(1);
if (itemstack.isEmpty()) {
@@ -67,7 +83,8 @@
@@ -101,7 +117,8 @@
}
entityhuman.a(StatisticList.USE_CAULDRON);
@@ -62,7 +63,7 @@
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
@@ -77,6 +94,10 @@
@@ -111,6 +128,10 @@
if (item == Items.GLASS_BOTTLE) {
if (i > 0 && !world.isClientSide) {
@@ -73,7 +74,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1 = PotionUtil.a(new ItemStack(Items.POTION), Potions.WATER);
entityhuman.a(StatisticList.USE_CAULDRON);
@@ -91,12 +112,17 @@
@@ -125,12 +146,17 @@
}
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
@@ -92,7 +93,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1 = new ItemStack(Items.GLASS_BOTTLE);
entityhuman.a(StatisticList.USE_CAULDRON);
@@ -107,7 +133,8 @@
@@ -141,7 +167,8 @@
}
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
@@ -102,7 +103,7 @@
}
return EnumInteractionResult.a(world.isClientSide);
@@ -116,8 +143,13 @@
@@ -150,8 +177,13 @@
IDyeable idyeable = (IDyeable) item;
if (idyeable.a(itemstack) && !world.isClientSide) {
@@ -117,7 +118,7 @@
entityhuman.a(StatisticList.CLEAN_ARMOR);
return EnumInteractionResult.SUCCESS;
}
@@ -125,13 +157,18 @@
@@ -159,13 +191,18 @@
if (i > 0 && item instanceof ItemBanner) {
if (TileEntityBanner.b(itemstack) > 0 && !world.isClientSide) {
@@ -137,7 +138,7 @@
}
if (itemstack.isEmpty()) {
@@ -169,9 +206,25 @@
@@ -203,9 +240,25 @@
}
}
@@ -164,7 +165,7 @@
}
@Override
@@ -183,7 +236,7 @@
@@ -217,7 +270,7 @@
IBlockData iblockdata = world.getType(blockposition);
if ((Integer) iblockdata.get(BlockCauldron.LEVEL) < 3) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockChest.java
+++ b/net/minecraft/server/BlockChest.java
@@ -35,24 +35,7 @@
--- a/net/minecraft/world/level/block/BlockChest.java
+++ b/net/minecraft/world/level/block/BlockChest.java
@@ -79,24 +79,7 @@
public Optional<ITileInventory> a(final TileEntityChest tileentitychest, final TileEntityChest tileentitychest1) {
final InventoryLargeChest inventorylargechest = new InventoryLargeChest(tileentitychest, tileentitychest1);
@@ -26,7 +26,7 @@
}
public Optional<ITileInventory> a(TileEntityChest tileentitychest) {
@@ -65,6 +48,38 @@
@@ -109,6 +92,38 @@
}
};
@@ -65,7 +65,7 @@
protected BlockChest(BlockBase.Info blockbase_info, Supplier<TileEntityTypes<? extends TileEntityChest>> supplier) {
super(blockbase_info, supplier);
this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockChest.FACING, EnumDirection.NORTH)).set(BlockChest.c, BlockPropertyChestType.SINGLE)).set(BlockChest.d, false));
@@ -218,7 +233,7 @@
@@ -262,7 +277,7 @@
}
public DoubleBlockFinder.Result<? extends TileEntityChest> a(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockChorusFlower.java
+++ b/net/minecraft/server/BlockChorusFlower.java
@@ -4,6 +4,8 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockChorusFlower.java
+++ b/net/minecraft/world/level/block/BlockChorusFlower.java
@@ -20,6 +20,8 @@
import net.minecraft.world.level.block.state.properties.BlockStateInteger;
import net.minecraft.world.phys.MovingObjectPositionBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockChorusFlower extends Block {
public static final BlockStateInteger AGE = BlockProperties.ah;
@@ -68,8 +70,12 @@
@@ -84,8 +86,12 @@
}
if (flag && b((IWorldReader) worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmpty(blockposition.up(2))) {
@@ -24,7 +24,7 @@
} else if (i < 4) {
j = random.nextInt(4);
if (flag1) {
@@ -83,18 +89,30 @@
@@ -99,18 +105,30 @@
BlockPosition blockposition2 = blockposition.shift(enumdirection);
if (worldserver.isEmpty(blockposition2) && worldserver.isEmpty(blockposition2.down()) && b((IWorldReader) worldserver, blockposition2, enumdirection.opposite())) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockCocoa.java
+++ b/net/minecraft/server/BlockCocoa.java
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockCocoa.java
+++ b/net/minecraft/world/level/block/BlockCocoa.java
@@ -21,6 +21,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.af;
@@ -27,7 +29,7 @@
@@ -45,7 +47,7 @@
int i = (Integer) iblockdata.get(BlockCocoa.AGE);
if (i < 2) {
@@ -18,7 +18,7 @@
}
}
@@ -97,7 +99,7 @@
@@ -115,7 +117,7 @@
@Override
public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockCommand.java
+++ b/net/minecraft/server/BlockCommand.java
@@ -4,6 +4,8 @@
--- a/net/minecraft/world/level/block/BlockCommand.java
+++ b/net/minecraft/world/level/block/BlockCommand.java
@@ -27,6 +27,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -9,7 +9,7 @@
public class BlockCommand extends BlockTileEntity {
private static final Logger LOGGER = LogManager.getLogger();
@@ -32,6 +34,15 @@
@@ -55,6 +57,15 @@
TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity;
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
boolean flag2 = tileentitycommand.f();

View File

@@ -1,10 +1,11 @@
--- a/net/minecraft/server/BlockComposter.java
+++ b/net/minecraft/server/BlockComposter.java
@@ -5,12 +5,17 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockComposter.java
+++ b/net/minecraft/world/level/block/BlockComposter.java
@@ -36,12 +36,18 @@
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import net.minecraft.world.entity.Entity;
+import org.bukkit.craftbukkit.inventory.CraftBlockInventoryHolder;
+import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
+// CraftBukkit end
@@ -19,7 +20,7 @@
for (int i = 0; i < 8; ++i) {
avoxelshape[i] = VoxelShapes.a(BlockComposter.c, Block.a(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), OperatorBoolean.ONLY_FIRST);
}
@@ -156,18 +161,25 @@
@@ -187,18 +193,25 @@
return EnumInteractionResult.a(world.isClientSide);
} else if (i == 8) {
@@ -48,7 +49,7 @@
itemstack.subtract(1);
return iblockdata1;
@@ -176,7 +188,15 @@
@@ -207,7 +220,15 @@
}
}
@@ -65,7 +66,7 @@
if (!world.isClientSide) {
float f = 0.7F;
double d0 = (double) (world.random.nextFloat() * 0.7F) + 0.15000000596046448D;
@@ -202,10 +222,16 @@
@@ -233,10 +254,16 @@
}
private static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, ItemStack itemstack) {
@@ -83,7 +84,7 @@
return iblockdata;
} else {
int j = i + 1;
@@ -253,7 +279,8 @@
@@ -284,7 +311,8 @@
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
int i = (Integer) iblockdata.get(BlockComposter.a);
@@ -93,7 +94,7 @@
}
static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
@@ -265,6 +292,7 @@
@@ -296,6 +324,7 @@
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
super(1);
@@ -101,7 +102,7 @@
this.a = iblockdata;
this.b = generatoraccess;
this.c = blockposition;
@@ -317,6 +345,7 @@
@@ -348,6 +377,7 @@
this.blockData = iblockdata;
this.generatorAccess = generatoraccess;
this.blockPosition = blockposition;
@@ -109,7 +110,7 @@
}
@Override
@@ -341,15 +370,23 @@
@@ -372,15 +402,23 @@
@Override
public void update() {

View File

@@ -1,7 +1,8 @@
--- a/net/minecraft/server/BlockConcretePowder.java
+++ b/net/minecraft/server/BlockConcretePowder.java
@@ -1,5 +1,10 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/BlockConcretePowder.java
+++ b/net/minecraft/world/level/block/BlockConcretePowder.java
@@ -13,6 +13,11 @@
import net.minecraft.world.level.block.state.BlockBase;
import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlockState;
@@ -11,7 +12,7 @@
public class BlockConcretePowder extends BlockFalling {
private final IBlockData a;
@@ -12,7 +17,7 @@
@@ -25,7 +30,7 @@
@Override
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, EntityFallingBlock entityfallingblock) {
if (canHarden(world, blockposition, iblockdata1)) {
@@ -20,7 +21,7 @@
}
}
@@ -23,7 +28,24 @@
@@ -36,7 +41,24 @@
BlockPosition blockposition = blockactioncontext.getClickPosition();
IBlockData iblockdata = world.getType(blockposition);
@@ -46,7 +47,7 @@
}
private static boolean canHarden(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata) {
@@ -59,6 +81,24 @@
@@ -72,6 +94,24 @@
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockCoral.java
+++ b/net/minecraft/server/BlockCoral.java
@@ -15,6 +15,11 @@
--- a/net/minecraft/world/level/block/BlockCoral.java
+++ b/net/minecraft/world/level/block/BlockCoral.java
@@ -26,6 +26,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!this.a((IBlockAccess) worldserver, blockposition)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockCoralFan.java
+++ b/net/minecraft/server/BlockCoralFan.java
@@ -19,6 +19,11 @@
--- a/net/minecraft/world/level/block/BlockCoralFan.java
+++ b/net/minecraft/world/level/block/BlockCoralFan.java
@@ -29,6 +29,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockCoralFanWall.java
+++ b/net/minecraft/server/BlockCoralFanWall.java
@@ -19,6 +19,11 @@
--- a/net/minecraft/world/level/block/BlockCoralFanWall.java
+++ b/net/minecraft/world/level/block/BlockCoralFanWall.java
@@ -29,6 +29,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockCoralPlant.java
+++ b/net/minecraft/server/BlockCoralPlant.java
@@ -20,6 +20,11 @@
--- a/net/minecraft/world/level/block/BlockCoralPlant.java
+++ b/net/minecraft/world/level/block/BlockCoralPlant.java
@@ -32,6 +32,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockCrops.java
+++ b/net/minecraft/server/BlockCrops.java
@@ -2,6 +2,8 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockCrops.java
+++ b/net/minecraft/world/level/block/BlockCrops.java
@@ -18,6 +18,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.ai;
@@ -56,7 +58,7 @@
@@ -72,7 +74,7 @@
float f = a((Block) this, (IBlockAccess) worldserver, blockposition);
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
@@ -18,7 +18,7 @@
}
}
}
@@ -71,7 +73,7 @@
@@ -87,7 +89,7 @@
i = j;
}
@@ -27,7 +27,7 @@
}
protected int a(World world) {
@@ -129,7 +131,7 @@
@@ -145,7 +147,7 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockDaylightDetector.java
+++ b/net/minecraft/server/BlockDaylightDetector.java
@@ -43,6 +43,7 @@
--- a/net/minecraft/world/level/block/BlockDaylightDetector.java
+++ b/net/minecraft/world/level/block/BlockDaylightDetector.java
@@ -65,6 +65,7 @@
i = MathHelper.clamp(i, 0, 15);
if ((Integer) iblockdata.get(BlockDaylightDetector.POWER) != i) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockDiodeAbstract.java
+++ b/net/minecraft/server/BlockDiodeAbstract.java
@@ -2,6 +2,8 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockDiodeAbstract.java
+++ b/net/minecraft/world/level/block/BlockDiodeAbstract.java
@@ -20,6 +20,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
protected static final VoxelShape b = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
@@ -28,8 +30,18 @@
@@ -46,8 +48,18 @@
boolean flag1 = this.a((World) worldserver, blockposition, iblockdata);
if (flag && !flag1) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockDirtSnowSpreadable.java
+++ b/net/minecraft/server/BlockDirtSnowSpreadable.java
@@ -32,6 +32,11 @@
--- a/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
+++ b/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
@@ -42,6 +42,11 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!b(iblockdata, (IWorldReader) worldserver, blockposition)) {
@@ -12,7 +12,7 @@
worldserver.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
} else {
if (worldserver.getLightLevel(blockposition.up()) >= 9) {
@@ -41,7 +46,7 @@
@@ -51,7 +56,7 @@
BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockDispenser.java
+++ b/net/minecraft/server/BlockDispenser.java
@@ -8,9 +8,10 @@
--- a/net/minecraft/world/level/block/BlockDispenser.java
+++ b/net/minecraft/world/level/block/BlockDispenser.java
@@ -41,9 +41,10 @@
public static final BlockStateDirection FACING = BlockDirectional.FACING;
public static final BlockStateBoolean TRIGGERED = BlockProperties.A;
@@ -12,7 +12,7 @@
public static void a(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
BlockDispenser.REGISTRY.put(imaterial.getItem(), idispensebehavior);
@@ -53,6 +54,7 @@
@@ -86,6 +87,7 @@
IDispenseBehavior idispensebehavior = this.a(itemstack);
if (idispensebehavior != IDispenseBehavior.NONE) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockDoor.java
+++ b/net/minecraft/server/BlockDoor.java
@@ -2,6 +2,8 @@
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockDoor.java
+++ b/net/minecraft/world/level/block/BlockDoor.java
@@ -31,6 +31,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockDoor extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@@ -157,9 +159,24 @@
@@ -186,9 +188,24 @@
@Override
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {

View File

@@ -1,14 +1,15 @@
--- a/net/minecraft/server/BlockDragonEgg.java
+++ b/net/minecraft/server/BlockDragonEgg.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/BlockDragonEgg.java
+++ b/net/minecraft/world/level/block/BlockDragonEgg.java
@@ -15,6 +15,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit
+
public class BlockDragonEgg extends BlockFalling {
protected static final VoxelShape a = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);
@@ -29,6 +31,18 @@
@@ -44,6 +46,18 @@
BlockPosition blockposition1 = blockposition.b(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16));
if (world.getType(blockposition1).isAir()) {

View File

@@ -1,9 +1,11 @@
--- a/net/minecraft/server/BlockDropper.java
+++ b/net/minecraft/server/BlockDropper.java
@@ -1,5 +1,10 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/BlockDropper.java
+++ b/net/minecraft/world/level/block/BlockDropper.java
@@ -16,6 +16,12 @@
import net.minecraft.world.level.block.entity.TileEntityHopper;
import net.minecraft.world.level.block.state.BlockBase;
+// CraftBukkit start
+import net.minecraft.world.InventoryLargeChest;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.inventory.InventoryMoveItemEvent;
+// CraftBukkit end
@@ -11,7 +13,7 @@
public class BlockDropper extends BlockDispenser {
private static final IDispenseBehavior c = new DispenseBehaviorItem();
@@ -37,8 +42,25 @@
@@ -53,8 +59,25 @@
if (iinventory == null) {
itemstack1 = BlockDropper.c.dispense(sourceblock, itemstack);
} else {

View File

@@ -1,9 +1,12 @@
--- a/net/minecraft/server/BlockEnderPortal.java
+++ b/net/minecraft/server/BlockEnderPortal.java
@@ -1,5 +1,10 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/BlockEnderPortal.java
+++ b/net/minecraft/world/level/block/BlockEnderPortal.java
@@ -16,6 +16,13 @@
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import net.minecraft.server.level.EntityPlayer;
+import net.minecraft.world.level.dimension.DimensionManager;
+import org.bukkit.event.entity.EntityPortalEnterEvent;
+import org.bukkit.event.player.PlayerTeleportEvent;
+// CraftBukkit end
@@ -11,7 +14,7 @@
public class BlockEnderPortal extends BlockTileEntity {
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D);
@@ -21,13 +26,22 @@
@@ -37,13 +44,22 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if (world instanceof WorldServer && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockFenceGate.java
+++ b/net/minecraft/server/BlockFenceGate.java
@@ -103,6 +103,17 @@
--- a/net/minecraft/world/level/block/BlockFenceGate.java
+++ b/net/minecraft/world/level/block/BlockFenceGate.java
@@ -125,6 +125,17 @@
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
if (!world.isClientSide) {
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockFire.java
+++ b/net/minecraft/server/BlockFire.java
@@ -8,6 +8,13 @@
import java.util.function.Function;
import java.util.stream.Collectors;
--- a/net/minecraft/world/level/block/BlockFire.java
+++ b/net/minecraft/world/level/block/BlockFire.java
@@ -28,6 +28,13 @@
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlockState;
@@ -14,7 +14,7 @@
public class BlockFire extends BlockFireAbstract {
public static final BlockStateInteger AGE = BlockProperties.aj;
@@ -64,7 +71,24 @@
@@ -84,7 +91,24 @@
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
@@ -40,7 +40,7 @@
}
@Override
@@ -113,7 +137,7 @@
@@ -133,7 +157,7 @@
worldserver.getBlockTickList().a(blockposition, this, a(worldserver.random));
if (worldserver.getGameRules().getBoolean(GameRules.DO_FIRE_TICK)) {
if (!iblockdata.canPlace(worldserver, blockposition)) {
@@ -49,7 +49,7 @@
}
IBlockData iblockdata1 = worldserver.getType(blockposition.down());
@@ -121,7 +145,7 @@
@@ -141,7 +165,7 @@
int i = (Integer) iblockdata.get(BlockFire.AGE);
if (!flag && worldserver.isRaining() && this.a((World) worldserver, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) {
@@ -58,7 +58,7 @@
} else {
int j = Math.min(15, i + random.nextInt(3) / 2);
@@ -135,14 +159,14 @@
@@ -155,14 +179,14 @@
BlockPosition blockposition1 = blockposition.down();
if (!worldserver.getType(blockposition1).d(worldserver, blockposition1, EnumDirection.UP) || i > 3) {
@@ -75,7 +75,7 @@
return;
}
}
@@ -150,12 +174,14 @@
@@ -170,12 +194,14 @@
boolean flag1 = worldserver.u(blockposition);
int k = flag1 ? -50 : 0;
@@ -96,7 +96,7 @@
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
for (int l = -1; l <= 1; ++l) {
@@ -181,7 +207,15 @@
@@ -201,7 +227,15 @@
if (i2 > 0 && random.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.a((World) worldserver, (BlockPosition) blockposition_mutableblockposition))) {
int j2 = Math.min(15, i + random.nextInt(5) / 4);
@@ -113,7 +113,7 @@
}
}
}
@@ -205,12 +239,24 @@
@@ -225,12 +259,24 @@
return iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C) ? 0 : this.flameChances.getInt(iblockdata.getBlock());
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockFireAbstract.java
+++ b/net/minecraft/server/BlockFireAbstract.java
@@ -36,7 +36,14 @@
--- a/net/minecraft/world/level/block/BlockFireAbstract.java
+++ b/net/minecraft/world/level/block/BlockFireAbstract.java
@@ -50,7 +50,14 @@
if (!entity.isFireProof()) {
entity.setFireTicks(entity.getFireTicks() + 1);
if (entity.getFireTicks() == 0) {
@@ -16,7 +16,7 @@
}
entity.damageEntity(DamageSource.FIRE, this.b);
@@ -58,14 +65,14 @@
@@ -72,14 +79,14 @@
}
if (!iblockdata.canPlace(world, blockposition)) {
@@ -29,11 +29,11 @@
private static boolean a(World world) {
- return world.getDimensionKey() == World.OVERWORLD || world.getDimensionKey() == World.THE_NETHER;
+ return world.getTypeKey() == DimensionManager.OVERWORLD || world.getTypeKey() == DimensionManager.THE_NETHER; // CraftBukkit - getTypeKey()
+ return world.getTypeKey() == net.minecraft.world.level.dimension.DimensionManager.OVERWORLD || world.getTypeKey() == net.minecraft.world.level.dimension.DimensionManager.THE_NETHER; // CraftBukkit - getTypeKey()
}
@Override
@@ -109,4 +116,12 @@
@@ -123,4 +130,12 @@
}
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockFluids.java
+++ b/net/minecraft/server/BlockFluids.java
@@ -113,14 +113,20 @@
--- a/net/minecraft/world/level/block/BlockFluids.java
+++ b/net/minecraft/world/level/block/BlockFluids.java
@@ -137,14 +137,20 @@
if (world.getFluid(blockposition1).a((Tag) TagsFluid.WATER)) {
Block block = world.getFluid(blockposition).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockFungi.java
+++ b/net/minecraft/server/BlockFungi.java
@@ -38,6 +38,13 @@
--- a/net/minecraft/world/level/block/BlockFungi.java
+++ b/net/minecraft/world/level/block/BlockFungi.java
@@ -50,6 +50,13 @@
@Override
public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockGrass.java
+++ b/net/minecraft/server/BlockGrass.java
@@ -64,7 +64,7 @@
--- a/net/minecraft/world/level/block/BlockGrass.java
+++ b/net/minecraft/world/level/block/BlockGrass.java
@@ -72,7 +72,7 @@
}
if (iblockdata3.canPlace(worldserver, blockposition2)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockGrassPath.java
+++ b/net/minecraft/server/BlockGrassPath.java
@@ -31,6 +31,11 @@
--- a/net/minecraft/world/level/block/BlockGrassPath.java
+++ b/net/minecraft/world/level/block/BlockGrassPath.java
@@ -43,6 +43,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockGrowingTop.java
+++ b/net/minecraft/server/BlockGrowingTop.java
@@ -29,7 +29,7 @@
--- a/net/minecraft/world/level/block/BlockGrowingTop.java
+++ b/net/minecraft/world/level/block/BlockGrowingTop.java
@@ -44,7 +44,7 @@
BlockPosition blockposition1 = blockposition.shift(this.a);
if (this.h(worldserver.getType(blockposition1))) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockIce.java
+++ b/net/minecraft/server/BlockIce.java
@@ -36,6 +36,11 @@
--- a/net/minecraft/world/level/block/BlockIce.java
+++ b/net/minecraft/world/level/block/BlockIce.java
@@ -50,6 +50,11 @@
}
protected void melt(IBlockData iblockdata, World world, BlockPosition blockposition) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockJukeBox.java
+++ b/net/minecraft/server/BlockJukeBox.java
@@ -42,7 +42,13 @@
--- a/net/minecraft/world/level/block/BlockJukeBox.java
+++ b/net/minecraft/world/level/block/BlockJukeBox.java
@@ -63,7 +63,13 @@
TileEntity tileentity = generatoraccess.getTileEntity(blockposition);
if (tileentity instanceof TileEntityJukeBox) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockLeaves.java
+++ b/net/minecraft/server/BlockLeaves.java
@@ -2,6 +2,8 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockLeaves.java
+++ b/net/minecraft/world/level/block/BlockLeaves.java
@@ -19,6 +19,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapes;
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
+
public class BlockLeaves extends Block {
public static final BlockStateInteger DISTANCE = BlockProperties.an;
@@ -25,6 +27,14 @@
@@ -42,6 +44,14 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockLectern.java
+++ b/net/minecraft/server/BlockLectern.java
@@ -165,12 +165,13 @@
--- a/net/minecraft/world/level/block/BlockLectern.java
+++ b/net/minecraft/world/level/block/BlockLectern.java
@@ -196,12 +196,13 @@
}
private void d(IBlockData iblockdata, World world, BlockPosition blockposition) {

View File

@@ -1,14 +1,15 @@
--- a/net/minecraft/server/BlockLever.java
+++ b/net/minecraft/server/BlockLever.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/BlockLever.java
+++ b/net/minecraft/world/level/block/BlockLever.java
@@ -22,6 +22,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockLever extends BlockAttachable {
public static final BlockStateBoolean POWERED = BlockProperties.w;
@@ -64,6 +66,20 @@
@@ -86,6 +88,20 @@
return EnumInteractionResult.SUCCESS;
} else {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockMagma.java
+++ b/net/minecraft/server/BlockMagma.java
@@ -11,7 +11,9 @@
--- a/net/minecraft/world/level/block/BlockMagma.java
+++ b/net/minecraft/world/level/block/BlockMagma.java
@@ -28,7 +28,9 @@
@Override
public void stepOn(World world, BlockPosition blockposition, Entity entity) {
if (!entity.isFireProof() && entity instanceof EntityLiving && !EnchantmentManager.i((EntityLiving) entity)) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockMinecartDetector.java
+++ b/net/minecraft/server/BlockMinecartDetector.java
@@ -6,6 +6,8 @@
import java.util.function.Predicate;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockMinecartDetector.java
+++ b/net/minecraft/world/level/block/BlockMinecartDetector.java
@@ -26,6 +26,8 @@
import net.minecraft.world.level.block.state.properties.IBlockState;
import net.minecraft.world.phys.AxisAlignedBB;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.ad;
@@ -58,6 +60,16 @@
@@ -78,6 +80,16 @@
}
IBlockData iblockdata1;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockMobSpawner.java
+++ b/net/minecraft/server/BlockMobSpawner.java
@@ -14,9 +14,19 @@
--- a/net/minecraft/world/level/block/BlockMobSpawner.java
+++ b/net/minecraft/world/level/block/BlockMobSpawner.java
@@ -23,9 +23,19 @@
@Override
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockMonsterEggs.java
+++ b/net/minecraft/server/BlockMonsterEggs.java
@@ -3,6 +3,8 @@
import com.google.common.collect.Maps;
import java.util.Map;
--- a/net/minecraft/world/level/block/BlockMonsterEggs.java
+++ b/net/minecraft/world/level/block/BlockMonsterEggs.java
@@ -15,6 +15,8 @@
import net.minecraft.world.level.block.state.BlockBase;
import net.minecraft.world.level.block.state.IBlockData;
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; // CraftBukkit
+
public class BlockMonsterEggs extends Block {
private final Block a;
@@ -26,7 +28,7 @@
@@ -38,7 +40,7 @@
EntitySilverfish entitysilverfish = (EntitySilverfish) EntityTypes.SILVERFISH.a((World) worldserver);
entitysilverfish.setPositionRotation((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockMushroom.java
+++ b/net/minecraft/server/BlockMushroom.java
@@ -3,6 +3,10 @@
import java.util.Iterator;
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockMushroom.java
+++ b/net/minecraft/world/level/block/BlockMushroom.java
@@ -16,6 +16,10 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.TreeType;
@@ -11,7 +11,7 @@
public class BlockMushroom extends BlockPlant implements IBlockFragilePlantElement {
protected static final VoxelShape a = Block.a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D);
@@ -45,7 +49,7 @@
@@ -58,7 +62,7 @@
}
if (worldserver.isEmpty(blockposition2) && iblockdata.canPlace(worldserver, blockposition2)) {
@@ -20,7 +20,7 @@
}
}
@@ -69,6 +73,7 @@
@@ -82,6 +86,7 @@
WorldGenFeatureConfigured worldgenfeatureconfigured;
if (this == Blocks.BROWN_MUSHROOM) {
@@ -28,7 +28,7 @@
worldgenfeatureconfigured = BiomeDecoratorGroups.HUGE_BROWN_MUSHROOM;
} else {
if (this != Blocks.RED_MUSHROOM) {
@@ -76,6 +81,7 @@
@@ -89,6 +94,7 @@
return false;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockNetherWart.java
+++ b/net/minecraft/server/BlockNetherWart.java
@@ -33,7 +33,7 @@
--- a/net/minecraft/world/level/block/BlockNetherWart.java
+++ b/net/minecraft/world/level/block/BlockNetherWart.java
@@ -43,7 +43,7 @@
if (i < 3 && random.nextInt(10) == 0) {
iblockdata = (IBlockData) iblockdata.set(BlockNetherWart.AGE, i + 1);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockNote.java
+++ b/net/minecraft/server/BlockNote.java
@@ -27,7 +27,8 @@
--- a/net/minecraft/world/level/block/BlockNote.java
+++ b/net/minecraft/world/level/block/BlockNote.java
@@ -49,7 +49,8 @@
if (flag1 != (Boolean) iblockdata.get(BlockNote.POWERED)) {
if (flag1) {
@@ -10,7 +10,7 @@
}
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockNote.POWERED, flag1), 3);
@@ -35,9 +36,14 @@
@@ -57,9 +58,14 @@
}
@@ -27,7 +27,7 @@
}
}
@@ -49,7 +55,7 @@
@@ -71,7 +77,7 @@
} else {
iblockdata = (IBlockData) iblockdata.a((IBlockState) BlockNote.NOTE);
world.setTypeAndData(blockposition, iblockdata, 3);
@@ -36,7 +36,7 @@
entityhuman.a(StatisticList.TUNE_NOTEBLOCK);
return EnumInteractionResult.CONSUME;
}
@@ -58,7 +64,7 @@
@@ -80,7 +86,7 @@
@Override
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
if (!world.isClientSide) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockObserver.java
+++ b/net/minecraft/server/BlockObserver.java
@@ -2,6 +2,8 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockObserver.java
+++ b/net/minecraft/world/level/block/BlockObserver.java
@@ -14,6 +14,8 @@
import net.minecraft.world.level.block.state.properties.BlockProperties;
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockObserver extends BlockDirectional {
public static final BlockStateBoolean b = BlockProperties.w;
@@ -29,8 +31,18 @@
@@ -41,8 +43,18 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockObserver.b)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockOre.java
+++ b/net/minecraft/server/BlockOre.java
@@ -15,6 +15,7 @@
--- a/net/minecraft/world/level/block/BlockOre.java
+++ b/net/minecraft/world/level/block/BlockOre.java
@@ -23,6 +23,7 @@
@Override
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);
@@ -8,7 +8,7 @@
if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
int i = this.a(worldserver.random);
@@ -22,6 +23,21 @@
@@ -30,6 +31,21 @@
this.dropExperience(worldserver, blockposition, i);
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockPlant.java
+++ b/net/minecraft/server/BlockPlant.java
@@ -12,7 +12,14 @@
--- a/net/minecraft/world/level/block/BlockPlant.java
+++ b/net/minecraft/world/level/block/BlockPlant.java
@@ -21,7 +21,14 @@
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockPortal.java
+++ b/net/minecraft/server/BlockPortal.java
@@ -2,6 +2,10 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockPortal.java
+++ b/net/minecraft/world/level/block/BlockPortal.java
@@ -23,6 +23,10 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityPortalEnterEvent;
@@ -11,7 +11,7 @@
public class BlockPortal extends Block {
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.E;
@@ -32,7 +36,8 @@
@@ -53,7 +57,8 @@
}
if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) {
@@ -21,7 +21,7 @@
if (entity != null) {
entity.resetPortalCooldown();
@@ -54,6 +59,10 @@
@@ -75,6 +80,10 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.canPortal()) {

View File

@@ -1,14 +1,15 @@
--- a/net/minecraft/server/BlockPoweredRail.java
+++ b/net/minecraft/server/BlockPoweredRail.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/BlockPoweredRail.java
+++ b/net/minecraft/world/level/block/BlockPoweredRail.java
@@ -11,6 +11,8 @@
import net.minecraft.world.level.block.state.properties.BlockStateEnum;
import net.minecraft.world.level.block.state.properties.IBlockState;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockPoweredRail extends BlockMinecartTrackAbstract {
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.ad;
@@ -102,6 +104,13 @@
@@ -113,6 +115,13 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || this.a(world, blockposition, iblockdata, true, 0) || this.a(world, blockposition, iblockdata, false, 0);
if (flag1 != flag) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockPressurePlateAbstract.java
+++ b/net/minecraft/server/BlockPressurePlateAbstract.java
@@ -2,6 +2,8 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockPressurePlateAbstract.java
+++ b/net/minecraft/world/level/block/BlockPressurePlateAbstract.java
@@ -16,6 +16,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public abstract class BlockPressurePlateAbstract extends Block {
protected static final VoxelShape a = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 0.5D, 15.0D);
@@ -65,6 +67,19 @@
@@ -79,6 +81,19 @@
boolean flag = i > 0;
boolean flag1 = j > 0;

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockPressurePlateBinary.java
+++ b/net/minecraft/server/BlockPressurePlateBinary.java
@@ -3,6 +3,8 @@
import java.util.Iterator;
import java.util.List;
--- a/net/minecraft/world/level/block/BlockPressurePlateBinary.java
+++ b/net/minecraft/world/level/block/BlockPressurePlateBinary.java
@@ -18,6 +18,8 @@
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.AxisAlignedBB;
+import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
+
public class BlockPressurePlateBinary extends BlockPressurePlateAbstract {
public static final BlockStateBoolean POWERED = BlockProperties.w;
@@ -66,6 +68,26 @@
@@ -81,6 +83,26 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();

View File

@@ -1,14 +1,15 @@
--- a/net/minecraft/server/BlockPressurePlateWeighted.java
+++ b/net/minecraft/server/BlockPressurePlateWeighted.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/BlockPressurePlateWeighted.java
+++ b/net/minecraft/world/level/block/BlockPressurePlateWeighted.java
@@ -14,6 +14,8 @@
import net.minecraft.world.level.block.state.properties.BlockProperties;
import net.minecraft.world.level.block.state.properties.BlockStateInteger;
+import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
+
public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract {
public static final BlockStateInteger POWER = BlockProperties.az;
@@ -13,7 +15,31 @@
@@ -27,7 +29,31 @@
@Override
protected int b(World world, BlockPosition blockposition) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockPumpkinCarved.java
+++ b/net/minecraft/server/BlockPumpkinCarved.java
@@ -4,6 +4,11 @@
import java.util.function.Predicate;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockPumpkinCarved.java
+++ b/net/minecraft/world/level/block/BlockPumpkinCarved.java
@@ -26,6 +26,11 @@
import net.minecraft.world.level.block.state.properties.BlockStateDirection;
import net.minecraft.world.level.material.Material;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
@@ -12,7 +12,7 @@
public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWearable {
public static final BlockStateDirection a = BlockFacingHorizontal.FACING;
@@ -42,19 +47,28 @@
@@ -64,19 +69,28 @@
EntityPlayer entityplayer;
int j;
@@ -44,7 +44,7 @@
iterator = world.a(EntityPlayer.class, entitysnowman.getBoundingBox().g(5.0D)).iterator();
while (iterator.hasNext()) {
@@ -74,8 +88,8 @@
@@ -96,8 +110,8 @@
for (int k = 0; k < this.getIronGolemShape().b(); ++k) {
ShapeDetectorBlock shapedetectorblock2 = shapedetector_shapedetectorcollection.a(i, k, 0);
@@ -55,7 +55,7 @@
}
}
@@ -84,7 +98,15 @@
@@ -106,7 +120,15 @@
entityirongolem.setPlayerCreated(true);
entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F);

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockRedstoneComparator.java
+++ b/net/minecraft/server/BlockRedstoneComparator.java
@@ -4,6 +4,8 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockRedstoneComparator.java
+++ b/net/minecraft/world/level/block/BlockRedstoneComparator.java
@@ -28,6 +28,8 @@
import net.minecraft.world.phys.AxisAlignedBB;
import net.minecraft.world.phys.MovingObjectPositionBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity {
public static final BlockStateEnum<BlockPropertyComparatorMode> MODE = BlockProperties.aG;
@@ -67,7 +69,8 @@
@@ -91,7 +93,8 @@
@Nullable
private EntityItemFrame a(World world, EnumDirection enumdirection, BlockPosition blockposition) {
@@ -19,7 +19,7 @@
return entityitemframe != null && entityitemframe.getDirection() == enumdirection;
});
@@ -122,8 +125,18 @@
@@ -146,8 +149,18 @@
boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneComparator.c);
if (flag1 && !flag) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockRedstoneLamp.java
+++ b/net/minecraft/server/BlockRedstoneLamp.java
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockRedstoneLamp.java
+++ b/net/minecraft/world/level/block/BlockRedstoneLamp.java
@@ -12,6 +12,8 @@
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
import net.minecraft.world.level.block.state.properties.IBlockState;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockRedstoneLamp extends Block {
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
@@ -27,6 +29,11 @@
@@ -36,6 +38,11 @@
if (flag1) {
world.getBlockTickList().a(blockposition, this, 4);
} else {
@@ -21,7 +21,7 @@
world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2);
}
}
@@ -37,6 +44,11 @@
@@ -46,6 +53,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockRedstoneLamp.a) && !worldserver.isBlockIndirectlyPowered(blockposition)) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockRedstoneOre.java
+++ b/net/minecraft/server/BlockRedstoneOre.java
@@ -2,6 +2,11 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockRedstoneOre.java
+++ b/net/minecraft/world/level/block/BlockRedstoneOre.java
@@ -21,6 +21,11 @@
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
import net.minecraft.world.phys.MovingObjectPositionBlock;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -12,7 +12,7 @@
public class BlockRedstoneOre extends Block {
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
@@ -13,14 +18,30 @@
@@ -32,14 +37,30 @@
@Override
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
@@ -46,7 +46,7 @@
}
@Override
@@ -28,7 +49,7 @@
@@ -47,7 +68,7 @@
if (world.isClientSide) {
playEffect(world, blockposition);
} else {
@@ -55,7 +55,7 @@
}
ItemStack itemstack = entityhuman.b(enumhand);
@@ -36,9 +57,14 @@
@@ -55,9 +76,14 @@
return itemstack.getItem() instanceof ItemBlock && (new BlockActionContext(entityhuman, enumhand, itemstack, movingobjectpositionblock)).b() ? EnumInteractionResult.PASS : EnumInteractionResult.SUCCESS;
}
@@ -71,7 +71,7 @@
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, true), 3);
}
@@ -52,6 +78,11 @@
@@ -71,6 +97,11 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockRedstoneOre.a)) {
@@ -83,7 +83,7 @@
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, false), 3);
}
@@ -60,12 +91,25 @@
@@ -79,12 +110,25 @@
@Override
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockRedstoneTorch.java
+++ b/net/minecraft/server/BlockRedstoneTorch.java
@@ -6,6 +6,8 @@
import java.util.Random;
import java.util.WeakHashMap;
--- a/net/minecraft/world/level/block/BlockRedstoneTorch.java
+++ b/net/minecraft/world/level/block/BlockRedstoneTorch.java
@@ -17,6 +17,8 @@
import net.minecraft.world.level.block.state.properties.BlockProperties;
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneTorch extends BlockTorch {
public static final BlockStateBoolean LIT = BlockProperties.r;
@@ -62,8 +64,24 @@
@@ -73,8 +75,24 @@
list.remove(0);
}
@@ -34,7 +34,7 @@
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, false), 3);
if (a(worldserver, blockposition, true)) {
worldserver.triggerEffect(1502, blockposition, 0);
@@ -71,6 +89,15 @@
@@ -82,6 +100,15 @@
}
}
} else if (!flag && !a(worldserver, blockposition, false)) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockRedstoneWire.java
+++ b/net/minecraft/server/BlockRedstoneWire.java
@@ -9,6 +9,8 @@
import java.util.Set;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockRedstoneWire.java
+++ b/net/minecraft/world/level/block/BlockRedstoneWire.java
@@ -34,6 +34,8 @@
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
import net.minecraft.world.phys.shapes.VoxelShapes;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneWire extends Block {
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.X;
@@ -213,7 +215,16 @@
@@ -238,7 +240,16 @@
private void a(World world, BlockPosition blockposition, IBlockData iblockdata) {
int i = this.a(world, blockposition);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockReed.java
+++ b/net/minecraft/server/BlockReed.java
@@ -39,7 +39,7 @@
--- a/net/minecraft/world/level/block/BlockReed.java
+++ b/net/minecraft/world/level/block/BlockReed.java
@@ -55,7 +55,7 @@
int j = (Integer) iblockdata.get(BlockReed.AGE);
if (j == 15) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockSapling.java
+++ b/net/minecraft/server/BlockSapling.java
@@ -2,11 +2,19 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockSapling.java
+++ b/net/minecraft/world/level/block/BlockSapling.java
@@ -15,11 +15,19 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -20,7 +20,7 @@
protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, BlockBase.Info blockbase_info) {
super(blockbase_info);
@@ -22,7 +30,30 @@
@@ -35,7 +43,30 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (worldserver.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockScaffolding.java
+++ b/net/minecraft/server/BlockScaffolding.java
@@ -73,7 +73,7 @@
--- a/net/minecraft/world/level/block/BlockScaffolding.java
+++ b/net/minecraft/world/level/block/BlockScaffolding.java
@@ -94,7 +94,7 @@
int i = a((IBlockAccess) worldserver, blockposition);
IBlockData iblockdata1 = (IBlockData) ((IBlockData) iblockdata.set(BlockScaffolding.a, i)).set(BlockScaffolding.c, this.a(worldserver, blockposition, i));

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockSnow.java
+++ b/net/minecraft/server/BlockSnow.java
@@ -67,6 +67,11 @@
--- a/net/minecraft/world/level/block/BlockSnow.java
+++ b/net/minecraft/world/level/block/BlockSnow.java
@@ -85,6 +85,11 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (worldserver.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 11) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockSoil.java
+++ b/net/minecraft/server/BlockSoil.java
@@ -3,6 +3,11 @@
import java.util.Iterator;
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockSoil.java
+++ b/net/minecraft/world/level/block/BlockSoil.java
@@ -26,6 +26,11 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityInteractEvent;
@@ -12,7 +12,7 @@
public class BlockSoil extends Block {
public static final BlockStateInteger MOISTURE = BlockProperties.aw;
@@ -58,26 +63,49 @@
@@ -81,26 +86,49 @@
if (!a((IWorldReader) worldserver, blockposition) && !worldserver.isRainingAt(blockposition.up())) {
if (i > 0) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockSponge.java
+++ b/net/minecraft/server/BlockSponge.java
@@ -3,6 +3,13 @@
import com.google.common.collect.Lists;
import java.util.Queue;
--- a/net/minecraft/world/level/block/BlockSponge.java
+++ b/net/minecraft/world/level/block/BlockSponge.java
@@ -16,6 +16,13 @@
import net.minecraft.world.level.material.FluidTypes;
import net.minecraft.world.level.material.Material;
+// CraftBukkit start
+import java.util.List;
@@ -14,7 +14,7 @@
public class BlockSponge extends Block {
protected BlockSponge(BlockBase.Info blockbase_info) {
@@ -35,6 +42,7 @@
@@ -48,6 +55,7 @@
queue.add(new Tuple<>(blockposition, 0));
int i = 0;
@@ -22,7 +22,7 @@
while (!queue.isEmpty()) {
Tuple<BlockPosition, Integer> tuple = (Tuple) queue.poll();
@@ -46,27 +54,31 @@
@@ -59,27 +67,31 @@
for (int l = 0; l < k; ++l) {
EnumDirection enumdirection = aenumdirection[l];
BlockPosition blockposition2 = blockposition1.shift(enumdirection);
@@ -61,7 +61,7 @@
++i;
if (j < 6) {
queue.add(new Tuple<>(blockposition2, j + 1));
@@ -79,6 +91,39 @@
@@ -92,6 +104,39 @@
break;
}
}

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockStem.java
+++ b/net/minecraft/server/BlockStem.java
@@ -2,6 +2,8 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockStem.java
+++ b/net/minecraft/world/level/block/BlockStem.java
@@ -15,6 +15,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.ai;
@@ -34,14 +36,18 @@
@@ -47,14 +49,18 @@
if (i < 7) {
iblockdata = (IBlockData) iblockdata.set(BlockStem.AGE, i + 1);
@@ -30,7 +30,7 @@
worldserver.setTypeUpdate(blockposition, (IBlockData) this.blockFruit.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection));
}
}
@@ -65,7 +71,7 @@
@@ -78,7 +84,7 @@
int i = Math.min(7, (Integer) iblockdata.get(BlockStem.AGE) + MathHelper.nextInt(worldserver.random, 2, 5));
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockStem.AGE, i);

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockSweetBerryBush.java
+++ b/net/minecraft/server/BlockSweetBerryBush.java
@@ -2,6 +2,14 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockSweetBerryBush.java
+++ b/net/minecraft/world/level/block/BlockSweetBerryBush.java
@@ -26,6 +26,14 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import java.util.Collections;
@@ -15,7 +15,7 @@
public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger a = BlockProperties.ag;
@@ -28,7 +36,7 @@
@@ -52,7 +60,7 @@
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
if (i < 3 && random.nextInt(5) == 0 && worldserver.getLightLevel(blockposition.up(), 0) >= 9) {
@@ -24,7 +24,7 @@
}
}
@@ -42,7 +50,9 @@
@@ -66,7 +74,9 @@
double d1 = Math.abs(entity.locZ() - entity.F);
if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) {
@@ -34,7 +34,7 @@
}
}
@@ -59,7 +69,15 @@
@@ -83,7 +93,15 @@
} else if (i > 1) {
int j = 1 + world.random.nextInt(2);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockTNT.java
+++ b/net/minecraft/server/BlockTNT.java
@@ -94,6 +94,11 @@
--- a/net/minecraft/world/level/block/BlockTNT.java
+++ b/net/minecraft/world/level/block/BlockTNT.java
@@ -115,6 +115,11 @@
if (iprojectile.isBurning()) {
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockTallPlant.java
+++ b/net/minecraft/server/BlockTallPlant.java
@@ -66,6 +66,11 @@
--- a/net/minecraft/world/level/block/BlockTallPlant.java
+++ b/net/minecraft/world/level/block/BlockTallPlant.java
@@ -82,6 +82,11 @@
}
protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockTrapdoor.java
+++ b/net/minecraft/server/BlockTrapdoor.java
@@ -2,6 +2,8 @@
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockTrapdoor.java
+++ b/net/minecraft/world/level/block/BlockTrapdoor.java
@@ -27,6 +27,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged {
public static final BlockStateBoolean OPEN = BlockProperties.u;
@@ -88,6 +90,19 @@
@@ -113,6 +115,19 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
if (flag1 != (Boolean) iblockdata.get(BlockTrapdoor.c)) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockTripwire.java
+++ b/net/minecraft/server/BlockTripwire.java
@@ -5,6 +5,8 @@
import java.util.Map;
import java.util.Random;
--- a/net/minecraft/world/level/block/BlockTripwire.java
+++ b/net/minecraft/world/level/block/BlockTripwire.java
@@ -23,6 +23,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
+
public class BlockTripwire extends Block {
public static final BlockStateBoolean POWERED = BlockProperties.w;
@@ -132,6 +134,40 @@
@@ -150,6 +152,40 @@
}
}

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockTripwireHook.java
+++ b/net/minecraft/server/BlockTripwireHook.java
@@ -4,6 +4,8 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockTripwireHook.java
+++ b/net/minecraft/world/level/block/BlockTripwireHook.java
@@ -25,6 +25,8 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTripwireHook extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@@ -134,6 +136,17 @@
@@ -155,6 +157,17 @@
this.a(world, blockposition1, flag4, flag5, flag2, flag3);
}

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockTurtleEgg.java
+++ b/net/minecraft/server/BlockTurtleEgg.java
@@ -3,6 +3,12 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockTurtleEgg.java
+++ b/net/minecraft/world/level/block/BlockTurtleEgg.java
@@ -29,6 +29,12 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityInteractEvent;
@@ -13,7 +13,7 @@
public class BlockTurtleEgg extends Block {
private static final VoxelShape c = Block.a(3.0D, 0.0D, 3.0D, 12.0D, 7.0D, 12.0D);
@@ -36,6 +42,19 @@
@@ -62,6 +68,19 @@
IBlockData iblockdata = world.getType(blockposition);
if (iblockdata.a(Blocks.TURTLE_EGG)) {
@@ -33,7 +33,7 @@
this.a(world, blockposition, iblockdata);
}
}
@@ -62,9 +81,19 @@
@@ -88,9 +107,19 @@
int i = (Integer) iblockdata.get(BlockTurtleEgg.a);
if (i < 2) {
@@ -54,7 +54,7 @@
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
worldserver.a(blockposition, false);
@@ -75,7 +104,7 @@
@@ -101,7 +130,7 @@
entityturtle.setAgeRaw(-24000);
entityturtle.setHomePos(blockposition);
entityturtle.setPositionRotation((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F);

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockVine.java
+++ b/net/minecraft/server/BlockVine.java
@@ -8,6 +8,8 @@
import java.util.stream.Collectors;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockVine.java
+++ b/net/minecraft/world/level/block/BlockVine.java
@@ -23,6 +23,8 @@
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
import net.minecraft.world.phys.shapes.VoxelShapes;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockVine extends Block {
public static final BlockStateBoolean UP = BlockSprawling.e;
@@ -175,20 +177,24 @@
@@ -190,20 +192,24 @@
BlockPosition blockposition3 = blockposition2.shift(enumdirection1);
BlockPosition blockposition4 = blockposition2.shift(enumdirection2);
@@ -39,7 +39,7 @@
}
} else if (a((IBlockAccess) worldserver, blockposition2, enumdirection)) {
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), true), 2);
@@ -218,7 +224,7 @@
@@ -233,7 +239,7 @@
}
if (this.canSpread(iblockdata2)) {
@@ -48,7 +48,7 @@
}
return;
@@ -233,7 +239,7 @@
@@ -248,7 +254,7 @@
IBlockData iblockdata4 = this.a(iblockdata, iblockdata3, random);
if (iblockdata3 != iblockdata4 && this.canSpread(iblockdata4)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockWaterLily.java
+++ b/net/minecraft/server/BlockWaterLily.java
@@ -11,7 +11,7 @@
--- a/net/minecraft/world/level/block/BlockWaterLily.java
+++ b/net/minecraft/world/level/block/BlockWaterLily.java
@@ -25,7 +25,7 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
super.a(iblockdata, world, blockposition, entity);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockWitherRose.java
+++ b/net/minecraft/server/BlockWitherRose.java
@@ -18,7 +18,7 @@
--- a/net/minecraft/world/level/block/BlockWitherRose.java
+++ b/net/minecraft/world/level/block/BlockWitherRose.java
@@ -31,7 +31,7 @@
EntityLiving entityliving = (EntityLiving) entity;
if (!entityliving.isInvulnerable(DamageSource.WITHER)) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockWitherSkull.java
+++ b/net/minecraft/server/BlockWitherSkull.java
@@ -3,6 +3,11 @@
import java.util.Iterator;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/BlockWitherSkull.java
+++ b/net/minecraft/world/level/block/BlockWitherSkull.java
@@ -27,6 +27,11 @@
import net.minecraft.world.level.block.state.predicate.MaterialPredicate;
import net.minecraft.world.level.material.Material;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
@@ -12,7 +12,7 @@
public class BlockWitherSkull extends BlockSkull {
@Nullable
@@ -26,6 +31,7 @@
@@ -50,6 +55,7 @@
}
public static void a(World world, BlockPosition blockposition, TileEntitySkull tileentityskull) {
@@ -20,7 +20,7 @@
if (!world.isClientSide) {
IBlockData iblockdata = tileentityskull.getBlock();
boolean flag = iblockdata.a(Blocks.WITHER_SKELETON_SKULL) || iblockdata.a(Blocks.WITHER_SKELETON_WALL_SKULL);
@@ -35,12 +41,14 @@
@@ -59,12 +65,14 @@
ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = shapedetector.a(world, blockposition);
if (shapedetector_shapedetectorcollection != null) {
@@ -37,7 +37,7 @@
}
}
@@ -50,6 +58,15 @@
@@ -74,6 +82,15 @@
entitywither.setPositionRotation((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F);
entitywither.aA = shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F;
entitywither.beginSpawnSequence();
@@ -53,7 +53,7 @@
Iterator iterator = world.a(EntityPlayer.class, entitywither.getBoundingBox().g(50.0D)).iterator();
while (iterator.hasNext()) {
@@ -58,7 +75,7 @@
@@ -82,7 +99,7 @@
CriterionTriggers.n.a(entityplayer, (Entity) entitywither);
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntity.java
+++ b/net/minecraft/server/TileEntity.java
@@ -5,8 +5,18 @@
--- a/net/minecraft/world/level/block/entity/TileEntity.java
+++ b/net/minecraft/world/level/block/entity/TileEntity.java
@@ -15,8 +15,18 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Supplier;
@@ -19,14 +19,14 @@
private static final Logger LOGGER = LogManager.getLogger();
private final TileEntityTypes<?> tileType;
@Nullable
@@ -38,6 +48,14 @@
@@ -48,6 +58,14 @@
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
this.position = new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z"));
+ // CraftBukkit start - read container
+ this.persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY);
+
+ NBTBase persistentDataTag = nbttagcompound.get("PublicBukkitValues");
+ net.minecraft.nbt.NBTBase persistentDataTag = nbttagcompound.get("PublicBukkitValues");
+ if (persistentDataTag instanceof NBTTagCompound) {
+ this.persistentDataContainer.putAll((NBTTagCompound) persistentDataTag);
+ }
@@ -34,7 +34,7 @@
}
public NBTTagCompound save(NBTTagCompound nbttagcompound) {
@@ -54,6 +72,11 @@
@@ -64,6 +82,11 @@
nbttagcompound.setInt("x", this.position.getX());
nbttagcompound.setInt("y", this.position.getY());
nbttagcompound.setInt("z", this.position.getZ());
@@ -46,7 +46,7 @@
return nbttagcompound;
}
}
@@ -169,4 +192,13 @@
@@ -179,4 +202,13 @@
}, this::getPosition});
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityBanner.java
+++ b/net/minecraft/server/TileEntityBanner.java
@@ -70,6 +70,11 @@
--- a/net/minecraft/world/level/block/entity/TileEntityBanner.java
+++ b/net/minecraft/world/level/block/entity/TileEntityBanner.java
@@ -80,6 +80,11 @@
}
this.patterns = nbttagcompound.getList("Patterns", 10);

View File

@@ -1,7 +1,8 @@
--- a/net/minecraft/server/TileEntityBarrel.java
+++ b/net/minecraft/server/TileEntityBarrel.java
@@ -1,7 +1,49 @@
package net.minecraft.server;
--- a/net/minecraft/world/level/block/entity/TileEntityBarrel.java
+++ b/net/minecraft/world/level/block/entity/TileEntityBarrel.java
@@ -19,8 +19,50 @@
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import java.util.ArrayList;
@@ -50,7 +51,7 @@
private NonNullList<ItemStack> items;
private int b;
@@ -100,7 +142,7 @@
@@ -119,7 +161,7 @@
return;
}

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/TileEntityBeacon.java
+++ b/net/minecraft/server/TileEntityBeacon.java
@@ -8,6 +8,11 @@
import java.util.stream.Collectors;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntityBeacon.java
+++ b/net/minecraft/world/level/block/entity/TileEntityBeacon.java
@@ -38,6 +38,11 @@
import net.minecraft.world.level.levelgen.HeightMap;
import net.minecraft.world.phys.AxisAlignedBB;
+// CraftBukkit start
+import org.bukkit.craftbukkit.potion.CraftPotionUtil;
@@ -12,7 +12,7 @@
public class TileEntityBeacon extends TileEntity implements ITileInventory, ITickable {
public static final MobEffectList[][] a = new MobEffectList[][]{{MobEffects.FASTER_MOVEMENT, MobEffects.FASTER_DIG}, {MobEffects.RESISTANCE, MobEffects.JUMP}, {MobEffects.INCREASE_DAMAGE}, {MobEffects.REGENERATION}};
@@ -24,6 +29,15 @@
@@ -54,6 +59,15 @@
public IChatBaseComponent customName;
public ChestLock chestLock;
private final IContainerProperties containerProperties;
@@ -28,7 +28,7 @@
public TileEntityBeacon() {
super(TileEntityTypes.BEACON);
@@ -192,39 +206,78 @@
@@ -222,39 +236,78 @@
super.al_();
}
@@ -117,7 +117,7 @@
public void a(SoundEffect soundeffect) {
this.world.playSound((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
@@ -254,8 +307,11 @@
@@ -284,8 +337,11 @@
@Override
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
super.load(iblockdata, nbttagcompound);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityBeehive.java
+++ b/net/minecraft/server/TileEntityBeehive.java
@@ -10,6 +10,7 @@
--- a/net/minecraft/world/level/block/entity/TileEntityBeehive.java
+++ b/net/minecraft/world/level/block/entity/TileEntityBeehive.java
@@ -29,6 +29,7 @@
private final List<TileEntityBeehive.HiveBee> bees = Lists.newArrayList();
@Nullable
public BlockPosition flowerPos = null;
@@ -8,7 +8,7 @@
public TileEntityBeehive() {
super(TileEntityTypes.BEEHIVE);
@@ -49,7 +50,7 @@
@@ -68,7 +69,7 @@
}
public boolean isFull() {
@@ -17,7 +17,7 @@
}
public void a(@Nullable EntityHuman entityhuman, IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
@@ -66,7 +67,7 @@
@@ -85,7 +86,7 @@
if (entityhuman.getPositionVector().distanceSquared(entity.getPositionVector()) <= 16.0D) {
if (!this.isSedated()) {
@@ -26,7 +26,7 @@
} else {
entitybee.setCannotEnterHiveTicks(400);
}
@@ -78,10 +79,16 @@
@@ -97,10 +98,16 @@
}
private List<Entity> releaseBees(IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
@@ -44,7 +44,7 @@
});
return list;
}
@@ -107,7 +114,19 @@
@@ -126,7 +133,19 @@
}
public void a(Entity entity, boolean flag, int i) {
@@ -65,7 +65,7 @@
entity.stopRiding();
entity.ejectPassengers();
NBTTagCompound nbttagcompound = new NBTTagCompound();
@@ -133,7 +152,13 @@
@@ -152,7 +171,13 @@
}
private boolean releaseBee(IBlockData iblockdata, TileEntityBeehive.HiveBee tileentitybeehive_hivebee, @Nullable List<Entity> list, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
@@ -80,7 +80,7 @@
return false;
} else {
BlockPosition blockposition = this.getPosition();
@@ -157,6 +182,18 @@
@@ -176,6 +201,18 @@
if (!entity.getEntityType().a((Tag) TagsEntity.BEEHIVE_INHABITORS)) {
return false;
} else {
@@ -99,7 +99,7 @@
if (entity instanceof EntityBee) {
EntityBee entitybee = (EntityBee) entity;
@@ -186,6 +223,7 @@
@@ -205,6 +242,7 @@
list.add(entitybee);
}
@@ -107,7 +107,7 @@
float f = entity.getWidth();
double d0 = flag ? 0.0D : 0.55D + (double) (f / 2.0F);
double d1 = (double) blockposition.getX() + 0.5D + d0 * (double) enumdirection.getAdjacentX();
@@ -193,10 +231,11 @@
@@ -212,10 +250,11 @@
double d3 = (double) blockposition.getZ() + 0.5D + d0 * (double) enumdirection.getAdjacentZ();
entity.setPositionRotation(d1, d2, d3, entity.yaw, entity.pitch);
@@ -120,7 +120,7 @@
}
} else {
return false;
@@ -234,6 +273,10 @@
@@ -253,6 +292,10 @@
if (this.releaseBee(iblockdata, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus)) {
iterator.remove();
@@ -131,7 +131,7 @@
}
}
}
@@ -276,6 +319,11 @@
@@ -295,6 +338,11 @@
this.flowerPos = GameProfileSerializer.b(nbttagcompound.getCompound("FlowerPos"));
}
@@ -143,7 +143,7 @@
}
@Override
@@ -285,6 +333,7 @@
@@ -304,6 +352,7 @@
if (this.x()) {
nbttagcompound.set("FlowerPos", GameProfileSerializer.a(this.flowerPos));
}

View File

@@ -1,11 +1,12 @@
--- a/net/minecraft/server/TileEntityBrewingStand.java
+++ b/net/minecraft/server/TileEntityBrewingStand.java
@@ -4,6 +4,16 @@
import java.util.Iterator;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
+++ b/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
@@ -24,6 +24,17 @@
import net.minecraft.world.level.block.BlockBrewingStand;
import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import java.util.List;
+import net.minecraft.server.MinecraftServer;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.entity.HumanEntity;
@@ -17,7 +18,7 @@
public class TileEntityBrewingStand extends TileEntityContainer implements IWorldInventory, ITickable {
private static final int[] b = new int[]{3};
@@ -15,6 +25,36 @@
@@ -35,6 +46,36 @@
private Item k;
public int fuelLevel;
protected final IContainerProperties a;
@@ -54,7 +55,7 @@
public TileEntityBrewingStand() {
super(TileEntityTypes.BREWING_STAND);
@@ -83,8 +123,19 @@
@@ -103,8 +144,19 @@
ItemStack itemstack = (ItemStack) this.items.get(4);
if (this.fuelLevel <= 0 && itemstack.getItem() == Items.BLAZE_POWDER) {
@@ -76,7 +77,7 @@
this.update();
}
@@ -92,9 +143,14 @@
@@ -112,9 +164,14 @@
boolean flag1 = this.brewTime > 0;
ItemStack itemstack1 = (ItemStack) this.items.get(3);
@@ -93,7 +94,7 @@
if (flag2 && flag) {
this.j();
@@ -168,6 +224,16 @@
@@ -188,6 +245,16 @@
private void j() {
ItemStack itemstack = (ItemStack) this.items.get(3);

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/TileEntityCampfire.java
+++ b/net/minecraft/server/TileEntityCampfire.java
@@ -4,6 +4,12 @@
import java.util.Random;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntityCampfire.java
+++ b/net/minecraft/world/level/block/entity/TileEntityCampfire.java
@@ -21,6 +21,12 @@
import net.minecraft.world.level.block.BlockCampfire;
import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
@@ -13,7 +13,7 @@
public class TileEntityCampfire extends TileEntity implements Clearable, ITickable {
private final NonNullList<ItemStack> items;
@@ -55,6 +61,20 @@
@@ -72,6 +78,20 @@
}).orElse(itemstack);
BlockPosition blockposition = this.getPosition();

View File

@@ -1,10 +1,11 @@
--- a/net/minecraft/server/TileEntityChest.java
+++ b/net/minecraft/server/TileEntityChest.java
@@ -3,6 +3,11 @@
import java.util.Iterator;
import java.util.List;
--- a/net/minecraft/world/level/block/entity/TileEntityChest.java
+++ b/net/minecraft/world/level/block/entity/TileEntityChest.java
@@ -27,6 +27,12 @@
import net.minecraft.world.level.block.state.properties.BlockPropertyChestType;
import net.minecraft.world.phys.AxisAlignedBB;
+// CraftBukkit start
+import net.minecraft.world.level.block.Blocks;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
+// CraftBukkit end
@@ -12,7 +13,7 @@
public class TileEntityChest extends TileEntityLootable implements ITickable {
private NonNullList<ItemStack> items;
@@ -11,6 +16,37 @@
@@ -35,6 +41,37 @@
public int viewingCount;
private int j;
@@ -50,7 +51,7 @@
protected TileEntityChest(TileEntityTypes<?> tileentitytypes) {
super(tileentitytypes);
this.items = NonNullList.a(27, ItemStack.b);
@@ -61,6 +97,13 @@
@@ -85,6 +122,13 @@
this.b = this.a;
float f = 0.1F;
@@ -64,7 +65,7 @@
if (this.viewingCount > 0 && this.a == 0.0F) {
this.playOpenSound(SoundEffects.BLOCK_CHEST_OPEN);
}
@@ -155,8 +198,20 @@
@@ -179,8 +223,20 @@
if (this.viewingCount < 0) {
this.viewingCount = 0;
}
@@ -85,7 +86,7 @@
this.onOpen();
}
@@ -165,7 +220,18 @@
@@ -189,7 +245,18 @@
@Override
public void closeContainer(EntityHuman entityhuman) {
if (!entityhuman.isSpectator()) {
@@ -104,7 +105,7 @@
this.onOpen();
}
@@ -175,7 +241,7 @@
@@ -199,7 +266,7 @@
Block block = this.getBlock().getBlock();
if (block instanceof BlockChest) {
@@ -113,7 +114,7 @@
this.world.applyPhysics(this.position, block);
}
@@ -216,4 +282,11 @@
@@ -240,4 +307,11 @@
protected Container createContainer(int i, PlayerInventory playerinventory) {
return ContainerChest.a(i, playerinventory, this);
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityCommand.java
+++ b/net/minecraft/server/TileEntityCommand.java
@@ -9,6 +9,13 @@
--- a/net/minecraft/world/level/block/entity/TileEntityCommand.java
+++ b/net/minecraft/world/level/block/entity/TileEntityCommand.java
@@ -24,6 +24,13 @@
private boolean c;
private boolean g;
private final CommandBlockListenerAbstract h = new CommandBlockListenerAbstract() {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/TileEntityConduit.java
+++ b/net/minecraft/server/TileEntityConduit.java
@@ -7,6 +7,11 @@
import java.util.UUID;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntityConduit.java
+++ b/net/minecraft/world/level/block/entity/TileEntityConduit.java
@@ -27,6 +27,11 @@
import net.minecraft.world.phys.AxisAlignedBB;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
@@ -12,7 +12,7 @@
public class TileEntityConduit extends TileEntity implements ITickable {
private static final Block[] b = new Block[]{Blocks.PRISMARINE, Blocks.PRISMARINE_BRICKS, Blocks.SEA_LANTERN, Blocks.DARK_PRISMARINE};
@@ -158,7 +163,7 @@
@@ -178,7 +183,7 @@
EntityHuman entityhuman = (EntityHuman) iterator.next();
if (this.position.a((BaseBlockPosition) entityhuman.getChunkCoordinates(), (double) j) && entityhuman.isInWaterOrRain()) {
@@ -21,7 +21,7 @@
}
}
@@ -175,7 +180,7 @@
@@ -195,7 +200,7 @@
this.target = this.x();
this.k = null;
} else if (this.target == null) {
@@ -30,7 +30,7 @@
return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain();
});
@@ -187,8 +192,13 @@
@@ -207,8 +212,13 @@
}
if (this.target != null) {
@@ -46,7 +46,7 @@
}
if (entityliving != this.target) {
@@ -221,7 +231,7 @@
@@ -241,7 +251,7 @@
@Nullable
private EntityLiving x() {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityContainer.java
+++ b/net/minecraft/server/TileEntityContainer.java
@@ -76,4 +76,12 @@
--- a/net/minecraft/world/level/block/entity/TileEntityContainer.java
+++ b/net/minecraft/world/level/block/entity/TileEntityContainer.java
@@ -89,4 +89,12 @@
}
protected abstract Container createContainer(int i, PlayerInventory playerinventory);

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/TileEntityDispenser.java
+++ b/net/minecraft/server/TileEntityDispenser.java
@@ -2,11 +2,48 @@
import java.util.Random;
--- a/net/minecraft/world/level/block/entity/TileEntityDispenser.java
+++ b/net/minecraft/world/level/block/entity/TileEntityDispenser.java
@@ -13,11 +13,48 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import java.util.List;

View File

@@ -1,10 +1,11 @@
--- a/net/minecraft/server/TileEntityEndGateway.java
+++ b/net/minecraft/server/TileEntityEndGateway.java
@@ -7,6 +7,13 @@
--- a/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
+++ b/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
@@ -30,6 +30,14 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import net.minecraft.world.level.dimension.DimensionManager;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftPlayer;
@@ -14,7 +15,7 @@
public class TileEntityEndGateway extends TileEntityEnderPortal implements ITickable {
private static final Logger LOGGER = LogManager.getLogger();
@@ -117,7 +124,7 @@
@@ -140,7 +148,7 @@
public void b(Entity entity) {
if (this.world instanceof WorldServer && !this.f()) {
this.c = 100;
@@ -23,7 +24,7 @@
this.a((WorldServer) this.world);
}
@@ -142,6 +149,27 @@
@@ -165,6 +173,27 @@
entity1 = entity.getRootVehicle();
}
@@ -51,7 +52,7 @@
entity1.resetPortalCooldown();
entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);
}
@@ -246,7 +274,7 @@
@@ -269,7 +298,7 @@
}
private void a(WorldServer worldserver, BlockPosition blockposition) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/TileEntityFurnace.java
+++ b/net/minecraft/server/TileEntityFurnace.java
@@ -10,6 +10,17 @@
import java.util.Map;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntityFurnace.java
+++ b/net/minecraft/world/level/block/entity/TileEntityFurnace.java
@@ -39,6 +39,17 @@
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
@@ -18,7 +18,7 @@
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable {
private static final int[] g = new int[]{0};
@@ -137,6 +148,36 @@
@@ -166,6 +177,36 @@
return map;
}
@@ -55,7 +55,7 @@
private static boolean b(Item item) {
return TagsItem.NON_FLAMMABLE_WOOD.isTagged(item);
}
@@ -223,12 +264,23 @@
@@ -252,12 +293,23 @@
this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal);
}
} else {
@@ -82,7 +82,7 @@
flag1 = true;
if (!itemstack.isEmpty()) {
Item item = itemstack.getItem();
@@ -290,11 +342,38 @@
@@ -319,11 +371,38 @@
ItemStack itemstack1 = irecipe.getResult();
ItemStack itemstack2 = (ItemStack) this.items.get(2);
@@ -121,7 +121,7 @@
if (!this.world.isClientSide) {
this.a(irecipe);
@@ -319,7 +398,7 @@
@@ -348,7 +427,7 @@
}
protected int getRecipeCookingTime() {
@@ -130,7 +130,7 @@
}
public static boolean isFuel(ItemStack itemstack) {
@@ -446,14 +525,20 @@
@@ -475,14 +554,20 @@
@Override
public void b(EntityHuman entityhuman) {}
@@ -153,7 +153,7 @@
List<IRecipe<?>> list = Lists.newArrayList();
ObjectIterator objectiterator = this.n.object2IntEntrySet().iterator();
@@ -462,14 +547,14 @@
@@ -491,14 +576,14 @@
world.getCraftingManager().getRecipe((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
list.add(irecipe);
@@ -170,7 +170,7 @@
int j = MathHelper.d((float) i * f);
float f1 = MathHelper.h((float) i * f);
@@ -477,6 +562,14 @@
@@ -506,6 +591,14 @@
++j;
}

View File

@@ -1,10 +1,12 @@
--- a/net/minecraft/server/TileEntityHopper.java
+++ b/net/minecraft/server/TileEntityHopper.java
@@ -7,12 +7,51 @@
import java.util.stream.IntStream;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntityHopper.java
+++ b/net/minecraft/world/level/block/entity/TileEntityHopper.java
@@ -33,12 +33,53 @@
import net.minecraft.world.phys.shapes.OperatorBoolean;
import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import net.minecraft.world.InventoryLargeChest;
+import net.minecraft.world.entity.vehicle.EntityMinecartHopper;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.entity.HumanEntity;
@@ -52,7 +54,7 @@
public TileEntityHopper() {
super(TileEntityTypes.HOPPER);
this.items = NonNullList.a(5, ItemStack.b);
@@ -138,7 +177,28 @@
@@ -164,7 +205,28 @@
for (int i = 0; i < this.getSize(); ++i) {
if (!this.getItem(i).isEmpty()) {
ItemStack itemstack = this.getItem(i).cloneItemStack();
@@ -82,7 +84,7 @@
if (itemstack1.isEmpty()) {
iinventory.update();
@@ -203,7 +263,34 @@
@@ -229,7 +291,34 @@
if (!itemstack.isEmpty() && b(iinventory, itemstack, i, enumdirection)) {
ItemStack itemstack1 = itemstack.cloneItemStack();
@@ -118,7 +120,7 @@
if (itemstack2.isEmpty()) {
iinventory.update();
@@ -218,6 +305,13 @@
@@ -244,6 +333,13 @@
public static boolean a(IInventory iinventory, EntityItem entityitem) {
boolean flag = false;

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/TileEntityLectern.java
+++ b/net/minecraft/server/TileEntityLectern.java
@@ -2,9 +2,63 @@
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntityLectern.java
+++ b/net/minecraft/world/level/block/entity/TileEntityLectern.java
@@ -27,9 +27,63 @@
import net.minecraft.world.phys.Vec2F;
import net.minecraft.world.phys.Vec3D;
-public class TileEntityLectern extends TileEntity implements Clearable, ITileInventory {
+// CraftBukkit start
@@ -66,7 +66,7 @@
@Override
public int getSize() {
return 1;
@@ -49,11 +103,20 @@
@@ -74,11 +128,20 @@
}
@Override
@@ -89,7 +89,7 @@
}
@Override
@@ -135,7 +198,7 @@
@@ -160,7 +223,7 @@
if (j != this.page) {
this.page = j;
this.update();
@@ -98,7 +98,7 @@
}
}
@@ -158,6 +221,32 @@
@@ -183,6 +246,32 @@
return itemstack;
}
@@ -131,7 +131,7 @@
private CommandListenerWrapper a(@Nullable EntityHuman entityhuman) {
String s;
Object object;
@@ -172,7 +261,8 @@
@@ -197,7 +286,8 @@
Vec3D vec3d = Vec3D.a((BaseBlockPosition) this.position);
@@ -141,7 +141,7 @@
}
@Override
@@ -211,7 +301,7 @@
@@ -236,7 +326,7 @@
@Override
public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/TileEntityShulkerBox.java
+++ b/net/minecraft/server/TileEntityShulkerBox.java
@@ -4,6 +4,11 @@
import java.util.stream.IntStream;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
+++ b/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
@@ -29,6 +29,11 @@
import net.minecraft.world.phys.Vec3D;
import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
@@ -12,7 +12,7 @@
public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory, ITickable {
private static final int[] a = IntStream.range(0, 27).toArray();
@@ -16,6 +21,37 @@
@@ -41,6 +46,37 @@
private EnumColor l;
private boolean m;
@@ -50,7 +50,7 @@
public TileEntityShulkerBox(@Nullable EnumColor enumcolor) {
super(TileEntityTypes.SHULKER_BOX);
this.contents = NonNullList.a(27, ItemStack.b);
@@ -178,6 +214,7 @@
@@ -203,6 +239,7 @@
}
++this.viewingCount;
@@ -58,7 +58,7 @@
this.world.playBlockAction(this.position, this.getBlock().getBlock(), 1, this.viewingCount);
if (this.viewingCount == 1) {
this.world.playSound((EntityHuman) null, this.position, SoundEffects.BLOCK_SHULKER_BOX_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
@@ -190,6 +227,7 @@
@@ -215,6 +252,7 @@
public void closeContainer(EntityHuman entityhuman) {
if (!entityhuman.isSpectator()) {
--this.viewingCount;

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/server/TileEntitySign.java
+++ b/net/minecraft/server/TileEntitySign.java
@@ -3,7 +3,7 @@
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/block/entity/TileEntitySign.java
+++ b/net/minecraft/world/level/block/entity/TileEntitySign.java
@@ -23,7 +23,7 @@
import net.minecraft.world.phys.Vec2F;
import net.minecraft.world.phys.Vec3D;
-public class TileEntitySign extends TileEntity {
+public class TileEntitySign extends TileEntity implements ICommandListener { // CraftBukkit - implements
public final IChatBaseComponent[] lines;
public boolean isEditable;
@@ -29,6 +29,12 @@
@@ -49,6 +49,12 @@
nbttagcompound.setString("Text" + (i + 1), s);
}
@@ -22,7 +22,7 @@
nbttagcompound.setString("Color", this.color.c());
return nbttagcompound;
}
@@ -39,18 +45,38 @@
@@ -59,18 +65,38 @@
super.load(iblockdata, nbttagcompound);
this.color = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK);
@@ -68,7 +68,7 @@
}
this.g[i] = null;
@@ -111,11 +137,37 @@
@@ -131,11 +157,37 @@
return true;
}
@@ -107,7 +107,7 @@
}
public EnumColor getColor() {
@@ -126,7 +178,7 @@
@@ -146,7 +198,7 @@
if (enumcolor != this.getColor()) {
this.color = enumcolor;
this.update();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/WorldGenMegaTreeProvider.java
+++ b/net/minecraft/server/WorldGenMegaTreeProvider.java
@@ -30,6 +30,7 @@
--- a/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
+++ b/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
@@ -39,6 +39,7 @@
return false;
} else {
((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.f).b();

Some files were not shown because too many files have changed in this diff Show More