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/CommandBlockListenerAbstract.java
+++ b/net/minecraft/server/CommandBlockListenerAbstract.java
@@ -17,6 +17,10 @@
--- a/net/minecraft/world/level/CommandBlockListenerAbstract.java
+++ b/net/minecraft/world/level/CommandBlockListenerAbstract.java
@@ -30,6 +30,10 @@
private IChatBaseComponent lastOutput;
private String command = "";
private IChatBaseComponent customName;
@@ -11,7 +11,7 @@
public CommandBlockListenerAbstract() {
this.customName = CommandBlockListenerAbstract.c;
@@ -113,7 +117,7 @@
@@ -126,7 +130,7 @@
});

View File

@@ -1,10 +1,11 @@
--- a/net/minecraft/server/Explosion.java
+++ b/net/minecraft/server/Explosion.java
@@ -15,6 +15,13 @@
import java.util.Set;
import javax.annotation.Nullable;
--- a/net/minecraft/world/level/Explosion.java
+++ b/net/minecraft/world/level/Explosion.java
@@ -42,6 +42,14 @@
import net.minecraft.world.phys.MovingObjectPosition;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import net.minecraft.world.entity.item.EntityFallingBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.Location;
@@ -14,7 +15,7 @@
public class Explosion {
private static final ExplosionDamageCalculator a = new ExplosionDamageCalculator();
@@ -32,11 +39,12 @@
@@ -59,11 +67,12 @@
private final ExplosionDamageCalculator l;
private final List<BlockPosition> blocks = Lists.newArrayList();
private final Map<EntityHuman, Vec3D> n = Maps.newHashMap();
@@ -28,7 +29,7 @@
this.posX = d0;
this.posY = d1;
this.posZ = d2;
@@ -86,6 +94,11 @@
@@ -113,6 +122,11 @@
}
public void a() {
@@ -40,7 +41,7 @@
Set<BlockPosition> set = Sets.newHashSet();
boolean flag = true;
@@ -119,7 +132,7 @@
@@ -146,7 +160,7 @@
f -= ((Float) optional.get() + 0.3F) * 0.3F;
}
@@ -49,7 +50,7 @@
set.add(blockposition);
}
@@ -163,7 +176,16 @@
@@ -190,7 +204,16 @@
double d12 = (double) a(vec3d, entity);
double d13 = (1.0D - d7) * d12;
@@ -67,7 +68,7 @@
double d14 = d13;
if (entity instanceof EntityLiving) {
@@ -205,6 +227,51 @@
@@ -232,6 +255,51 @@
Collections.shuffle(this.blocks, this.world.random);
Iterator iterator = this.blocks.iterator();
@@ -119,7 +120,7 @@
while (iterator.hasNext()) {
BlockPosition blockposition = (BlockPosition) iterator.next();
@@ -219,8 +286,8 @@
@@ -246,8 +314,8 @@
TileEntity tileentity = block.isTileEntity() ? this.world.getTileEntity(blockposition) : null;
LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).a(this.world.random).set(LootContextParameters.ORIGIN, Vec3D.a((BaseBlockPosition) blockposition)).set(LootContextParameters.TOOL, ItemStack.b).setOptional(LootContextParameters.BLOCK_ENTITY, tileentity).setOptional(LootContextParameters.THIS_ENTITY, this.source);
@@ -130,7 +131,7 @@
}
iblockdata.a(loottableinfo_builder).forEach((itemstack) -> {
@@ -250,7 +317,11 @@
@@ -277,7 +345,11 @@
BlockPosition blockposition2 = (BlockPosition) iterator1.next();
if (this.d.nextInt(3) == 0 && this.world.getType(blockposition2).isAir() && this.world.getType(blockposition2.down()).i(this.world, blockposition2.down())) {
@@ -143,7 +144,7 @@
}
}
}
@@ -258,6 +329,7 @@
@@ -285,6 +357,7 @@
}
private static void a(ObjectArrayList<Pair<ItemStack, BlockPosition>> objectarraylist, ItemStack itemstack, BlockPosition blockposition) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/GameRules.java
+++ b/net/minecraft/server/GameRules.java
@@ -106,7 +106,7 @@
--- a/net/minecraft/world/level/GameRules.java
+++ b/net/minecraft/world/level/GameRules.java
@@ -113,7 +113,7 @@
}
public <T extends GameRules.GameRuleValue<T>> T get(GameRules.GameRuleKey<T> gamerules_gamerulekey) {
@@ -9,7 +9,7 @@
}
public NBTTagCompound a() {
@@ -137,8 +137,8 @@
@@ -144,8 +144,8 @@
}
private static <T extends GameRules.GameRuleValue<T>> void a(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<?> gamerules_gamerulekey, GameRules.GameRuleDefinition<?> gamerules_gameruledefinition) {
@@ -20,7 +20,7 @@
}
public boolean getBoolean(GameRules.GameRuleKey<GameRules.GameRuleBoolean> gamerules_gamerulekey) {
@@ -189,7 +189,7 @@
@@ -196,7 +196,7 @@
}
@Override
@@ -29,7 +29,7 @@
this.b = Boolean.parseBoolean(s);
}
@@ -244,7 +244,7 @@
@@ -251,7 +251,7 @@
}
@Override
@@ -38,7 +38,7 @@
this.b = c(s);
}
@@ -298,7 +298,7 @@
@@ -305,7 +305,7 @@
}
@@ -47,7 +47,7 @@
public abstract String getValue();
@@ -332,7 +332,7 @@
@@ -339,7 +339,7 @@
}
public T getValue() {

View File

@@ -1,9 +1,9 @@
--- a/net/minecraft/server/GeneratorAccess.java
+++ b/net/minecraft/server/GeneratorAccess.java
@@ -46,4 +46,6 @@
--- a/net/minecraft/world/level/GeneratorAccess.java
+++ b/net/minecraft/world/level/GeneratorAccess.java
@@ -57,4 +57,6 @@
default void triggerEffect(int i, BlockPosition blockposition, int j) {
this.a((EntityHuman) null, i, blockposition, j);
}
+
+ WorldServer getMinecraftWorld(); // CraftBukkit
+ net.minecraft.server.level.WorldServer getMinecraftWorld(); // CraftBukkit
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/IBlockAccess.java
+++ b/net/minecraft/server/IBlockAccess.java
@@ -31,8 +31,8 @@
--- a/net/minecraft/world/level/IBlockAccess.java
+++ b/net/minecraft/world/level/IBlockAccess.java
@@ -41,8 +41,8 @@
return BlockPosition.a(axisalignedbb).map(this::getType);
}
@@ -11,7 +11,7 @@
IBlockData iblockdata = this.getType(blockposition);
Fluid fluid = this.getFluid(blockposition);
Vec3D vec3d = raytrace1.b();
@@ -45,6 +45,12 @@
@@ -55,6 +55,12 @@
double d1 = movingobjectpositionblock1 == null ? Double.MAX_VALUE : raytrace1.b().distanceSquared(movingobjectpositionblock1.getPos());
return d0 <= d1 ? movingobjectpositionblock : movingobjectpositionblock1;
@@ -24,7 +24,7 @@
}, (raytrace1) -> {
Vec3D vec3d = raytrace1.b().d(raytrace1.a());
@@ -120,7 +126,7 @@
@@ -130,7 +136,7 @@
double d13 = d10 * (i1 > 0 ? 1.0D - MathHelper.h(d4) : MathHelper.h(d4));
double d14 = d11 * (j1 > 0 ? 1.0D - MathHelper.h(d5) : MathHelper.h(d5));

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/IWorldWriter.java
+++ b/net/minecraft/server/IWorldWriter.java
@@ -25,4 +25,10 @@
--- a/net/minecraft/world/level/IWorldWriter.java
+++ b/net/minecraft/world/level/IWorldWriter.java
@@ -28,4 +28,10 @@
default boolean addEntity(Entity entity) {
return false;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MobSpawnerAbstract.java
+++ b/net/minecraft/server/MobSpawnerAbstract.java
@@ -43,6 +43,7 @@
--- a/net/minecraft/world/level/MobSpawnerAbstract.java
+++ b/net/minecraft/world/level/MobSpawnerAbstract.java
@@ -60,6 +60,7 @@
public void setMobName(EntityTypes<?> entitytypes) {
this.spawnData.getEntity().setString("id", IRegistry.ENTITY_TYPE.getKey(entitytypes).toString());
@@ -8,7 +8,7 @@
}
private boolean h() {
@@ -132,7 +133,7 @@
@@ -149,7 +150,7 @@
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/RayTrace.java
+++ b/net/minecraft/server/RayTrace.java
@@ -15,7 +15,7 @@
--- a/net/minecraft/world/level/RayTrace.java
+++ b/net/minecraft/world/level/RayTrace.java
@@ -24,7 +24,7 @@
this.b = vec3d1;
this.c = raytrace_blockcollisionoption;
this.d = raytrace_fluidcollisionoption;
@@ -9,7 +9,7 @@
}
public Vec3D a() {
@@ -44,7 +44,7 @@
@@ -53,7 +53,7 @@
private final Predicate<Fluid> predicate;

View File

@@ -1,17 +1,18 @@
--- a/net/minecraft/server/SpawnerCreature.java
+++ b/net/minecraft/server/SpawnerCreature.java
@@ -13,6 +13,10 @@
--- a/net/minecraft/world/level/SpawnerCreature.java
+++ b/net/minecraft/world/level/SpawnerCreature.java
@@ -45,6 +45,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import net.minecraft.world.level.storage.WorldData;
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
+// CraftBukkit end
+
public final class SpawnerCreature {
private static final Logger LOGGER = LogManager.getLogger();
@@ -34,7 +38,8 @@
@@ -66,7 +71,8 @@
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
@@ -21,7 +22,7 @@
continue;
}
}
@@ -69,10 +74,49 @@
@@ -101,10 +107,49 @@
EnumCreatureType[] aenumcreaturetype = SpawnerCreature.c;
int i = aenumcreaturetype.length;
@@ -72,7 +73,7 @@
a(enumcreaturetype, worldserver, chunk, (entitytypes, blockposition, ichunkaccess) -> {
return spawnercreature_d.a(entitytypes, blockposition, ichunkaccess);
}, (entityinsentient, ichunkaccess) -> {
@@ -147,10 +191,14 @@
@@ -179,10 +224,14 @@
entityinsentient.setPositionRotation(d0, (double) i, d1, worldserver.random.nextFloat() * 360.0F, 0.0F);
if (a(worldserver, entityinsentient, d2)) {
groupdataentity = entityinsentient.prepare(worldserver, worldserver.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
@@ -91,7 +92,7 @@
if (j >= entityinsentient.getMaxSpawnGroup()) {
return;
}
@@ -333,7 +381,7 @@
@@ -365,7 +414,7 @@
if (entityinsentient.a((GeneratorAccess) worldaccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.a((IWorldReader) worldaccess)) {
groupdataentity = entityinsentient.prepare(worldaccess, worldaccess.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, (NBTTagCompound) null);
@@ -100,7 +101,7 @@
flag = true;
}
}
@@ -456,8 +504,10 @@
@@ -488,8 +537,10 @@
return this.d;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/TickListServer.java
+++ b/net/minecraft/server/TickListServer.java
@@ -36,11 +36,17 @@
--- a/net/minecraft/world/level/TickListServer.java
+++ b/net/minecraft/world/level/TickListServer.java
@@ -48,11 +48,17 @@
public void b() {
int i = this.nextTickList.size();
@@ -20,7 +20,7 @@
}
ChunkProviderServer chunkproviderserver = this.e.getChunkProvider();
@@ -79,7 +85,7 @@
@@ -91,7 +97,7 @@
throw new ReportedException(crashreport);
}
} else {

View File

@@ -1,12 +1,16 @@
--- a/net/minecraft/server/World.java
+++ b/net/minecraft/server/World.java
@@ -14,6 +14,17 @@
--- a/net/minecraft/world/level/World.java
+++ b/net/minecraft/world/level/World.java
@@ -62,6 +62,21 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.HashMap;
+import java.util.Map;
+import net.minecraft.network.protocol.game.PacketPlayOutWorldBorder;
+import net.minecraft.server.level.WorldServer;
+import net.minecraft.world.entity.item.EntityItem;
+import net.minecraft.world.level.border.IWorldBorderListener;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
@@ -18,7 +22,7 @@
public abstract class World implements GeneratorAccess, AutoCloseable {
protected static final Logger LOGGER = LogManager.getLogger();
@@ -45,7 +56,49 @@
@@ -93,7 +108,49 @@
private final BiomeManager biomeManager;
private final ResourceKey<World> dimensionKey;
@@ -69,7 +73,7 @@
this.methodProfiler = supplier;
this.worldData = worlddatamutable;
this.x = dimensionmanager;
@@ -55,12 +108,12 @@
@@ -103,12 +160,12 @@
this.worldBorder = new WorldBorder() {
@Override
public double getCenterX() {
@@ -84,7 +88,7 @@
}
};
} else {
@@ -70,6 +123,35 @@
@@ -118,6 +175,35 @@
this.serverThread = Thread.currentThread();
this.biomeManager = new BiomeManager(this, i, dimensionmanager.getGenLayerZoomer());
this.debugWorld = flag1;
@@ -120,7 +124,7 @@
}
@Override
@@ -133,6 +215,17 @@
@@ -181,6 +267,17 @@
@Override
public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
@@ -138,7 +142,7 @@
if (isOutsideWorld(blockposition)) {
return false;
} else if (!this.isClientSide && this.isDebugWorld()) {
@@ -140,9 +233,24 @@
@@ -188,9 +285,24 @@
} else {
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
Block block = iblockdata.getBlock();
@@ -164,7 +168,7 @@
return false;
} else {
IBlockData iblockdata2 = this.getType(blockposition);
@@ -153,6 +261,7 @@
@@ -201,6 +313,7 @@
this.getMethodProfiler().exit();
}
@@ -172,7 +176,7 @@
if (iblockdata2 == iblockdata) {
if (iblockdata1 != iblockdata2) {
this.b(blockposition, iblockdata1, iblockdata2);
@@ -179,12 +288,65 @@
@@ -227,12 +340,65 @@
this.a(blockposition, iblockdata1, iblockdata2);
}
@@ -238,7 +242,7 @@
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
@Override
@@ -266,6 +428,17 @@
@@ -314,6 +480,17 @@
IBlockData iblockdata = this.getType(blockposition);
try {
@@ -256,7 +260,7 @@
iblockdata.doPhysics(this, blockposition, block, blockposition1, false);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours");
@@ -308,6 +481,14 @@
@@ -356,6 +533,14 @@
@Override
public IBlockData getType(BlockPosition blockposition) {
@@ -271,7 +275,7 @@
if (isOutsideWorld(blockposition)) {
return Blocks.VOID_AIR.getBlockData();
} else {
@@ -455,9 +636,11 @@
@@ -503,9 +688,11 @@
TileEntity tileentity1 = (TileEntity) this.tileEntityListPending.get(i);
if (!tileentity1.isRemoved()) {
@@ -283,7 +287,7 @@
if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
@@ -465,6 +648,12 @@
@@ -513,6 +700,12 @@
chunk.setTileEntity(tileentity1.getPosition(), tileentity1);
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
@@ -296,7 +300,7 @@
}
}
}
@@ -509,12 +698,25 @@
@@ -557,12 +750,25 @@
@Nullable
@Override
@@ -306,7 +310,7 @@
+ }
+
+ @Nullable
+ protected TileEntity getTileEntity(BlockPosition blockposition, boolean validate) {
+ public TileEntity getTileEntity(BlockPosition blockposition, boolean validate) {
+ // CraftBukkit end
if (isOutsideWorld(blockposition)) {
return null;
@@ -322,7 +326,7 @@
TileEntity tileentity = null;
if (this.tickingTileEntities) {
@@ -549,6 +751,13 @@
@@ -597,6 +803,13 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!isOutsideWorld(blockposition)) {
if (tileentity != null && !tileentity.isRemoved()) {
@@ -336,7 +340,7 @@
if (this.tickingTileEntities) {
tileentity.setLocation(this, blockposition);
Iterator iterator = this.tileEntityListPending.iterator();
@@ -573,7 +782,7 @@
@@ -621,7 +834,7 @@
}
public void removeTileEntity(BlockPosition blockposition) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/WorldAccess.java
+++ b/net/minecraft/server/WorldAccess.java
@@ -5,6 +5,12 @@
--- a/net/minecraft/world/level/WorldAccess.java
+++ b/net/minecraft/world/level/WorldAccess.java
@@ -8,6 +8,12 @@
WorldServer getMinecraftWorld();
default void addAllEntities(Entity entity) {

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();

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