@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/Block.java
|
||||
+++ b/net/minecraft/world/level/block/Block.java
|
||||
@@ -356,7 +356,13 @@
|
||||
@@ -354,7 +354,13 @@
|
||||
EntityItem entityitem = (EntityItem) supplier.get();
|
||||
|
||||
entityitem.setDefaultPickUpDelay();
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,7 +388,7 @@
|
||||
@@ -380,7 +386,7 @@
|
||||
|
||||
public void playerDestroy(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
|
||||
entityhuman.awardStat(StatisticList.BLOCK_MINED.get(this));
|
||||
@@ -24,7 +24,7 @@
|
||||
dropResources(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
|
||||
}
|
||||
|
||||
@@ -522,16 +528,24 @@
|
||||
@@ -516,16 +522,24 @@
|
||||
return this.builtInRegistryHolder;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBed.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBed.java
|
||||
@@ -87,7 +87,8 @@
|
||||
@@ -86,7 +86,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
world.removeBlock(blockposition, false);
|
||||
BlockPosition blockposition1 = blockposition.relative(((EnumDirection) iblockdata.getValue(BlockBed.FACING)).getOpposite());
|
||||
|
||||
@@ -104,7 +105,16 @@
|
||||
@@ -105,7 +106,16 @@
|
||||
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else {
|
||||
@@ -27,7 +27,7 @@
|
||||
if (entityhuman_enumbedresult.getMessage() != null) {
|
||||
entityhuman.displayClientMessage(entityhuman_enumbedresult.getMessage(), true);
|
||||
}
|
||||
@@ -115,8 +125,27 @@
|
||||
@@ -116,8 +126,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,9 @@
|
||||
+ world.removeBlock(blockposition1, false);
|
||||
+ }
|
||||
+
|
||||
+ world.explode((Entity) null, DamageSource.badRespawnPointExplosion(), (ExplosionDamageCalculator) null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY);
|
||||
+ Vec3D vec3d = blockposition.getCenter();
|
||||
+
|
||||
+ world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, World.a.BLOCK);
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockButtonAbstract.java
|
||||
+++ b/net/minecraft/world/level/block/BlockButtonAbstract.java
|
||||
@@ -27,6 +27,11 @@
|
||||
@@ -26,6 +26,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
+import org.bukkit.event.entity.EntityInteractEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public abstract class BlockButtonAbstract extends BlockAttachable {
|
||||
public class BlockButtonAbstract extends BlockAttachable {
|
||||
|
||||
public static final BlockStateBoolean POWERED = BlockProperties.POWERED;
|
||||
@@ -97,6 +102,19 @@
|
||||
@@ -109,6 +114,19 @@
|
||||
if ((Boolean) iblockdata.getValue(BlockButtonAbstract.POWERED)) {
|
||||
return EnumInteractionResult.CONSUME;
|
||||
} else {
|
||||
@@ -32,46 +32,22 @@
|
||||
this.press(iblockdata, world, blockposition);
|
||||
this.playSound(entityhuman, world, blockposition, true);
|
||||
world.gameEvent((Entity) entityhuman, GameEvent.BLOCK_ACTIVATE, blockposition);
|
||||
@@ -148,6 +166,16 @@
|
||||
if (this.sensitive) {
|
||||
this.checkPressed(iblockdata, worldserver, blockposition);
|
||||
} else {
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.block.Block block = worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+
|
||||
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 15, 0);
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
||||
+
|
||||
+ if (eventRedstone.getNewCurrent() > 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockButtonAbstract.POWERED, false), 3);
|
||||
this.updateNeighbours(iblockdata, worldserver, blockposition);
|
||||
this.playSound((EntityHuman) null, worldserver, blockposition, false);
|
||||
@@ -169,11 +197,48 @@
|
||||
boolean flag = !list.isEmpty();
|
||||
@@ -171,11 +189,36 @@
|
||||
}
|
||||
|
||||
protected void checkPressed(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
- EntityArrow entityarrow = this.arrowsCanPress ? (EntityArrow) world.getEntitiesOfClass(EntityArrow.class, iblockdata.getShape(world, blockposition).bounds().move(blockposition)).stream().findFirst().orElse((Object) null) : null;
|
||||
+ EntityArrow entityarrow = this.arrowsCanPress ? (EntityArrow) world.getEntitiesOfClass(EntityArrow.class, iblockdata.getShape(world, blockposition).bounds().move(blockposition)).stream().findFirst().orElse(null) : null; // CraftBukkit - decompile error
|
||||
boolean flag = entityarrow != null;
|
||||
boolean flag1 = (Boolean) iblockdata.getValue(BlockButtonAbstract.POWERED);
|
||||
|
||||
+ // CraftBukkit start - Call interact event when arrows turn on wooden buttons
|
||||
+ if (flag1 != flag && flag) {
|
||||
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ boolean allowed = false;
|
||||
+ EntityInteractEvent event = new EntityInteractEvent(entityarrow.getBukkitEntity(), block);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ // If all of the events are cancelled block the button press, else allow
|
||||
+ for (Object object : list) {
|
||||
+ if (object != null) {
|
||||
+ EntityInteractEvent event = new EntityInteractEvent(((Entity) object).getBukkitEntity(), block);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ allowed = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!allowed) {
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
@@ -94,8 +70,3 @@
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockButtonAbstract.POWERED, flag), 3);
|
||||
this.updateNeighbours(iblockdata, world, blockposition);
|
||||
this.playSound((EntityHuman) null, world, blockposition, flag);
|
||||
- world.gameEvent((Entity) list.stream().findFirst().orElse((Object) null), flag ? GameEvent.BLOCK_ACTIVATE : GameEvent.BLOCK_DEACTIVATE, blockposition);
|
||||
+ world.gameEvent((Entity) list.stream().findFirst().orElse(null), flag ? GameEvent.BLOCK_ACTIVATE : GameEvent.BLOCK_DEACTIVATE, blockposition); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDoor.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDoor.java
|
||||
@@ -33,6 +33,8 @@
|
||||
@@ -35,6 +35,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockDoor extends Block {
|
||||
|
||||
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
|
||||
@@ -191,9 +193,24 @@
|
||||
@@ -189,9 +191,24 @@
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
||||
@@ -34,5 +34,5 @@
|
||||
+ boolean flag1 = eventRedstone.getNewCurrent() > 0;
|
||||
+ // CraftBukkit end
|
||||
if (flag1 != (Boolean) iblockdata.getValue(BlockDoor.OPEN)) {
|
||||
this.playSound(world, blockposition, flag1);
|
||||
this.playSound((Entity) null, world, blockposition, flag1);
|
||||
world.gameEvent((Entity) null, flag1 ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, blockposition);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFenceGate.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFenceGate.java
|
||||
@@ -129,6 +129,17 @@
|
||||
@@ -142,6 +142,17 @@
|
||||
public void neighborChanged(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
||||
if (!world.isClientSide) {
|
||||
boolean flag1 = world.hasNeighborSignal(blockposition);
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFungi.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFungi.java
|
||||
@@ -51,6 +51,13 @@
|
||||
|
||||
@@ -59,6 +59,13 @@
|
||||
@Override
|
||||
public void performBonemeal(WorldServer worldserver, RandomSource randomsource, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
+ // CraftBukkit start
|
||||
+ if (this == Blocks.WARPED_FUNGUS) {
|
||||
+ BlockSapling.treeType = org.bukkit.TreeType.WARPED_FUNGUS;
|
||||
+ } else if (this == Blocks.CRIMSON_FUNGUS) {
|
||||
+ BlockSapling.treeType = org.bukkit.TreeType.CRIMSON_FUNGUS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
((WorldGenFeatureConfigured) ((Holder) this.feature.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), randomsource, blockposition);
|
||||
this.getFeature(worldserver).ifPresent((holder) -> {
|
||||
+ // CraftBukkit start
|
||||
+ if (this == Blocks.WARPED_FUNGUS) {
|
||||
+ BlockSapling.treeType = org.bukkit.TreeType.WARPED_FUNGUS;
|
||||
+ } else if (this == Blocks.CRIMSON_FUNGUS) {
|
||||
+ BlockSapling.treeType = org.bukkit.TreeType.CRIMSON_FUNGUS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
((WorldGenFeatureConfigured) holder.value()).place(worldserver, worldserver.getChunkSource().getGenerator(), randomsource, blockposition);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockMobSpawner.java
|
||||
+++ b/net/minecraft/world/level/block/BlockMobSpawner.java
|
||||
@@ -33,12 +33,20 @@
|
||||
@@ -43,12 +43,20 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
public class BlockMonsterEggs extends Block {
|
||||
|
||||
private final Block hostBlock;
|
||||
@@ -41,7 +43,7 @@
|
||||
EntitySilverfish entitysilverfish = (EntitySilverfish) EntityTypes.SILVERFISH.create(worldserver);
|
||||
@@ -42,7 +44,7 @@
|
||||
|
||||
entitysilverfish.moveTo((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
- worldserver.addFreshEntity(entitysilverfish);
|
||||
+ worldserver.addFreshEntity(entitysilverfish, SpawnReason.SILVERFISH_BLOCK); // CraftBukkit - add SpawnReason
|
||||
entitysilverfish.spawnAnim();
|
||||
}
|
||||
if (entitysilverfish != null) {
|
||||
entitysilverfish.moveTo((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
- worldserver.addFreshEntity(entitysilverfish);
|
||||
+ worldserver.addFreshEntity(entitysilverfish, SpawnReason.SILVERFISH_BLOCK); // CraftBukkit - add SpawnReason
|
||||
entitysilverfish.spawnAnim();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockMushroom.java
|
||||
+++ b/net/minecraft/world/level/block/BlockMushroom.java
|
||||
@@ -16,6 +16,10 @@
|
||||
@@ -18,6 +18,10 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class BlockMushroom extends BlockPlant implements IBlockFragilePlantElement {
|
||||
|
||||
protected static final float AABB_OFFSET = 3.0F;
|
||||
@@ -61,7 +65,7 @@
|
||||
@@ -63,7 +67,7 @@
|
||||
}
|
||||
|
||||
if (worldserver.isEmptyBlock(blockposition2) && iblockdata.canSurvive(worldserver, blockposition2)) {
|
||||
@@ -20,11 +20,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +86,7 @@
|
||||
|
||||
public boolean growMushroom(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, RandomSource randomsource) {
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
+ BlockSapling.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.BROWN_MUSHROOM; // CraftBukkit
|
||||
if (((WorldGenFeatureConfigured) ((Holder) this.featureSupplier.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), randomsource, blockposition)) {
|
||||
return true;
|
||||
@@ -89,6 +93,7 @@
|
||||
return false;
|
||||
} else {
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
+ BlockSapling.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.BROWN_MUSHROOM; // CraftBukkit
|
||||
if (((WorldGenFeatureConfigured) ((Holder) optional.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), randomsource, blockposition)) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
--- a/net/minecraft/world/level/block/BlockNote.java
|
||||
+++ b/net/minecraft/world/level/block/BlockNote.java
|
||||
@@ -51,7 +51,8 @@
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
if (flag1 != (Boolean) iblockdata.getValue(BlockNote.POWERED)) {
|
||||
if (flag1) {
|
||||
- this.playNote((Entity) null, world, blockposition);
|
||||
+ this.playNote((Entity) null, world, blockposition, iblockdata); // CraftBukkit
|
||||
this.playNote((Entity) null, iblockdata, world, blockposition);
|
||||
+ iblockdata = world.getBlockState(blockposition); // CraftBukkit - SPIGOT-5617: update in case changed in event
|
||||
}
|
||||
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockNote.POWERED, flag1), 3);
|
||||
@@ -59,11 +60,18 @@
|
||||
@@ -86,6 +87,12 @@
|
||||
|
||||
}
|
||||
|
||||
- private void playNote(@Nullable Entity entity, World world, BlockPosition blockposition) {
|
||||
+ private void playNote(@Nullable Entity entity, World world, BlockPosition blockposition, IBlockData data) { // CraftBukkit
|
||||
if (world.getBlockState(blockposition.above()).isAir()) {
|
||||
private void playNote(@Nullable Entity entity, IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
if (!((BlockPropertyInstrument) iblockdata.getValue(BlockNote.INSTRUMENT)).requiresAirAbove() || world.getBlockState(blockposition.above()).isAir()) {
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.getValue(BlockNote.INSTRUMENT), data.getValue(BlockNote.NOTE));
|
||||
+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, iblockdata.getValue(BlockNote.INSTRUMENT), iblockdata.getValue(BlockNote.NOTE));
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
@@ -26,25 +21,3 @@
|
||||
world.blockEvent(blockposition, this, 0, 0);
|
||||
world.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, blockposition);
|
||||
}
|
||||
+
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,7 +81,7 @@
|
||||
} else {
|
||||
iblockdata = (IBlockData) iblockdata.cycle(BlockNote.NOTE);
|
||||
world.setBlock(blockposition, iblockdata, 3);
|
||||
- this.playNote(entityhuman, world, blockposition);
|
||||
+ this.playNote(entityhuman, world, blockposition, iblockdata); // CraftBukkit
|
||||
entityhuman.awardStat(StatisticList.TUNE_NOTEBLOCK);
|
||||
return EnumInteractionResult.CONSUME;
|
||||
}
|
||||
@@ -82,7 +90,7 @@
|
||||
@Override
|
||||
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
|
||||
if (!world.isClientSide) {
|
||||
- this.playNote(entityhuman, world, blockposition);
|
||||
+ this.playNote(entityhuman, world, blockposition, iblockdata); // CraftBukkit
|
||||
entityhuman.awardStat(StatisticList.PLAY_NOTEBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockNylium.java
|
||||
+++ b/net/minecraft/world/level/block/BlockNylium.java
|
||||
@@ -31,6 +31,11 @@
|
||||
@@ -33,6 +33,11 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!canBeNylium(iblockdata, worldserver, blockposition)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockPortal.java
|
||||
+++ b/net/minecraft/world/level/block/BlockPortal.java
|
||||
@@ -27,6 +27,10 @@
|
||||
@@ -24,6 +24,10 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
public class BlockPortal extends Block {
|
||||
|
||||
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.HORIZONTAL_AXIS;
|
||||
@@ -58,7 +62,8 @@
|
||||
@@ -55,7 +59,8 @@
|
||||
}
|
||||
|
||||
if (worldserver.getBlockState(blockposition).isValidSpawn(worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) {
|
||||
- Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawn(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.above(), EnumMobSpawn.STRUCTURE, false, false);
|
||||
- Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawn(worldserver, blockposition.above(), EnumMobSpawn.STRUCTURE);
|
||||
+ // CraftBukkit - set spawn reason to NETHER_PORTAL
|
||||
+ Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawn(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.above(), EnumMobSpawn.STRUCTURE, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
|
||||
+ Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawn(worldserver, blockposition.above(), EnumMobSpawn.STRUCTURE, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
|
||||
|
||||
if (entity != null) {
|
||||
entity.setPortalCooldown();
|
||||
@@ -80,6 +85,10 @@
|
||||
@@ -77,6 +82,10 @@
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions()) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- 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;
|
||||
@@ -17,6 +17,8 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
+import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockPressurePlateBinary extends BlockPressurePlateAbstract {
|
||||
|
||||
public static final BlockStateBoolean POWERED = BlockProperties.POWERED;
|
||||
@@ -81,6 +83,26 @@
|
||||
@@ -74,6 +76,26 @@
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract {
|
||||
|
||||
public static final BlockStateInteger POWER = BlockProperties.POWER;
|
||||
@@ -27,7 +29,31 @@
|
||||
@@ -31,7 +33,31 @@
|
||||
|
||||
@Override
|
||||
protected int getSignalStrength(World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,74 +1,30 @@
|
||||
--- a/net/minecraft/world/level/block/BlockPumpkinCarved.java
|
||||
+++ b/net/minecraft/world/level/block/BlockPumpkinCarved.java
|
||||
@@ -26,6 +26,11 @@
|
||||
@@ -26,6 +26,10 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateDirection;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWearable {
|
||||
|
||||
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
|
||||
@@ -64,19 +69,28 @@
|
||||
EntityPlayer entityplayer;
|
||||
int j;
|
||||
@@ -82,9 +86,14 @@
|
||||
}
|
||||
|
||||
+ BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator
|
||||
if (shapedetector_shapedetectorcollection != null) {
|
||||
for (i = 0; i < this.getOrCreateSnowGolemFull().getHeight(); ++i) {
|
||||
ShapeDetectorBlock shapedetectorblock = shapedetector_shapedetectorcollection.getBlock(0, i, 0);
|
||||
private static void spawnGolemInWorld(World world, ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection, Entity entity, BlockPosition blockposition) {
|
||||
- clearPatternBlocks(world, shapedetector_shapedetectorcollection);
|
||||
+ // clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - moved down
|
||||
entity.moveTo((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.05D, (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
- world.addFreshEntity(entity);
|
||||
+ // CraftBukkit start
|
||||
+ if (!world.addFreshEntity(entity, SpawnReason.BUILD_IRONGOLEM)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - from above
|
||||
+ // CraftBukkit end
|
||||
Iterator iterator = world.getEntitiesOfClass(EntityPlayer.class, entity.getBoundingBox().inflate(5.0D)).iterator();
|
||||
|
||||
- world.setBlock(shapedetectorblock.getPos(), Blocks.AIR.defaultBlockState(), 2);
|
||||
- world.levelEvent(2001, shapedetectorblock.getPos(), Block.getId(shapedetectorblock.getState()));
|
||||
+ blockList.setBlock(shapedetectorblock.getPos(), Blocks.AIR.defaultBlockState(), 2); // CraftBukkit
|
||||
+ // world.levelEvent(2001, shapedetectorblock.getPos(), Block.getId(shapedetectorblock.getState())); // CraftBukkit
|
||||
}
|
||||
|
||||
EntitySnowman entitysnowman = (EntitySnowman) EntityTypes.SNOW_GOLEM.create(world);
|
||||
BlockPosition blockposition1 = shapedetector_shapedetectorcollection.getBlock(0, 2, 0).getPos();
|
||||
|
||||
entitysnowman.moveTo((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.05D, (double) blockposition1.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
- world.addFreshEntity(entitysnowman);
|
||||
+ // CraftBukkit start
|
||||
+ if (!world.addFreshEntity(entitysnowman, SpawnReason.BUILD_SNOWMAN)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ for (BlockPosition pos : blockList.getBlocks()) {
|
||||
+ world.levelEvent(2001, pos, Block.getId(world.getBlockState(pos)));
|
||||
+ }
|
||||
+ blockList.updateList();
|
||||
+ // CraftBukkit end
|
||||
iterator = world.getEntitiesOfClass(EntityPlayer.class, entitysnowman.getBoundingBox().inflate(5.0D)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -96,8 +110,8 @@
|
||||
for (int k = 0; k < this.getOrCreateIronGolemFull().getHeight(); ++k) {
|
||||
ShapeDetectorBlock shapedetectorblock2 = shapedetector_shapedetectorcollection.getBlock(i, k, 0);
|
||||
|
||||
- world.setBlock(shapedetectorblock2.getPos(), Blocks.AIR.defaultBlockState(), 2);
|
||||
- world.levelEvent(2001, shapedetectorblock2.getPos(), Block.getId(shapedetectorblock2.getState()));
|
||||
+ blockList.setBlock(shapedetectorblock2.getPos(), Blocks.AIR.defaultBlockState(), 2); // CraftBukkit
|
||||
+ // world.levelEvent(2001, shapedetectorblock2.getPos(), Block.getId(shapedetectorblock2.getState())); // CraftBukkit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +120,15 @@
|
||||
|
||||
entityirongolem.setPlayerCreated(true);
|
||||
entityirongolem.moveTo((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
- world.addFreshEntity(entityirongolem);
|
||||
+ // CraftBukkit start
|
||||
+ if (!world.addFreshEntity(entityirongolem, SpawnReason.BUILD_IRONGOLEM)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ for (BlockPosition pos : blockList.getBlocks()) {
|
||||
+ world.levelEvent(2001, pos, Block.getId(world.getBlockState(pos)));
|
||||
+ }
|
||||
+ blockList.updateList();
|
||||
+ // CraftBukkit end
|
||||
iterator = world.getEntitiesOfClass(EntityPlayer.class, entityirongolem.getBoundingBox().inflate(5.0D)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
while (iterator.hasNext()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockRedstoneWire.java
|
||||
+++ b/net/minecraft/world/level/block/BlockRedstoneWire.java
|
||||
@@ -37,6 +37,8 @@
|
||||
@@ -36,6 +36,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockRedstoneWire extends Block {
|
||||
|
||||
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.NORTH_REDSTONE;
|
||||
@@ -255,7 +257,16 @@
|
||||
@@ -254,7 +256,16 @@
|
||||
private void updatePowerStrength(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
int i = this.calculateTargetStrength(world, blockposition);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockSapling.java
|
||||
+++ b/net/minecraft/world/level/block/BlockSapling.java
|
||||
@@ -14,12 +14,20 @@
|
||||
@@ -15,12 +15,20 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, BlockBase.Info blockbase_info) {
|
||||
super(blockbase_info);
|
||||
@@ -44,7 +52,32 @@
|
||||
@@ -45,7 +53,32 @@
|
||||
if ((Integer) iblockdata.getValue(BlockSapling.STAGE) == 0) {
|
||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.cycle(BlockSapling.STAGE), 4);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockStem.java
|
||||
+++ b/net/minecraft/world/level/block/BlockStem.java
|
||||
@@ -20,6 +20,8 @@
|
||||
@@ -21,6 +21,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
|
||||
|
||||
public static final int MAX_AGE = 7;
|
||||
@@ -56,14 +58,18 @@
|
||||
@@ -57,14 +59,18 @@
|
||||
|
||||
if (i < 7) {
|
||||
iblockdata = (IBlockData) iblockdata.setValue(BlockStem.AGE, i + 1);
|
||||
@@ -30,7 +30,7 @@
|
||||
worldserver.setBlockAndUpdate(blockposition, (IBlockData) this.fruit.getAttachedStem().defaultBlockState().setValue(BlockFacingHorizontal.FACING, enumdirection));
|
||||
}
|
||||
}
|
||||
@@ -92,7 +98,7 @@
|
||||
@@ -93,7 +99,7 @@
|
||||
int i = Math.min(7, (Integer) iblockdata.getValue(BlockStem.AGE) + MathHelper.nextInt(worldserver.random, 2, 5));
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(BlockStem.AGE, i);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockSweetBerryBush.java
|
||||
+++ b/net/minecraft/world/level/block/BlockSweetBerryBush.java
|
||||
@@ -27,6 +27,14 @@
|
||||
@@ -28,6 +28,14 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement {
|
||||
|
||||
private static final float HURT_SPEED_THRESHOLD = 0.003F;
|
||||
@@ -62,7 +70,7 @@
|
||||
@@ -63,7 +71,7 @@
|
||||
if (i < 3 && randomsource.nextInt(5) == 0 && worldserver.getRawBrightness(blockposition.above(), 0) >= 9) {
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(BlockSweetBerryBush.AGE, i + 1);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
worldserver.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
|
||||
}
|
||||
|
||||
@@ -77,7 +85,9 @@
|
||||
@@ -78,7 +86,9 @@
|
||||
double d1 = Math.abs(entity.getZ() - entity.zOld);
|
||||
|
||||
if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) {
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +104,15 @@
|
||||
@@ -95,7 +105,15 @@
|
||||
} else if (i > 1) {
|
||||
int j = 1 + world.random.nextInt(2);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockTallPlant.java
|
||||
+++ b/net/minecraft/world/level/block/BlockTallPlant.java
|
||||
@@ -92,6 +92,11 @@
|
||||
@@ -94,6 +94,11 @@
|
||||
}
|
||||
|
||||
protected static void preventCreativeDropFromBottomPart(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockTrapdoor.java
|
||||
+++ b/net/minecraft/world/level/block/BlockTrapdoor.java
|
||||
@@ -28,6 +28,8 @@
|
||||
@@ -30,6 +30,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged {
|
||||
|
||||
public static final BlockStateBoolean OPEN = BlockProperties.OPEN;
|
||||
@@ -116,6 +118,19 @@
|
||||
@@ -113,6 +115,19 @@
|
||||
boolean flag1 = world.hasNeighborSignal(blockposition);
|
||||
|
||||
if (flag1 != (Boolean) iblockdata.getValue(BlockTrapdoor.POWERED)) {
|
||||
|
||||
@@ -54,12 +54,12 @@
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + randomsource.nextFloat() * 0.2F);
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
|
||||
@@ -104,7 +133,7 @@
|
||||
entityturtle.setAge(-24000);
|
||||
entityturtle.setHomePos(blockposition);
|
||||
entityturtle.moveTo((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F);
|
||||
- worldserver.addFreshEntity(entityturtle);
|
||||
+ worldserver.addFreshEntity(entityturtle, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // CraftBukkit
|
||||
@@ -105,7 +134,7 @@
|
||||
entityturtle.setAge(-24000);
|
||||
entityturtle.setHomePos(blockposition);
|
||||
entityturtle.moveTo((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F);
|
||||
- worldserver.addFreshEntity(entityturtle);
|
||||
+ worldserver.addFreshEntity(entityturtle, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // CraftBukkit
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
--- a/net/minecraft/world/level/block/BlockWitherSkull.java
|
||||
+++ b/net/minecraft/world/level/block/BlockWitherSkull.java
|
||||
@@ -26,6 +26,11 @@
|
||||
@@ -26,6 +26,10 @@
|
||||
import net.minecraft.world.level.block.state.predicate.MaterialPredicate;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class BlockWitherSkull extends BlockSkull {
|
||||
|
||||
@Nullable
|
||||
@@ -49,6 +54,7 @@
|
||||
@@ -49,6 +53,7 @@
|
||||
}
|
||||
|
||||
public static void checkSpawn(World world, BlockPosition blockposition, TileEntitySkull tileentityskull) {
|
||||
@@ -20,45 +19,32 @@
|
||||
if (!world.isClientSide) {
|
||||
IBlockData iblockdata = tileentityskull.getBlockState();
|
||||
boolean flag = iblockdata.is(Blocks.WITHER_SKELETON_SKULL) || iblockdata.is(Blocks.WITHER_SKELETON_WALL_SKULL);
|
||||
@@ -58,12 +64,14 @@
|
||||
ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = shapedetector.find(world, blockposition);
|
||||
@@ -60,12 +65,18 @@
|
||||
EntityWither entitywither = (EntityWither) EntityTypes.WITHER.create(world);
|
||||
|
||||
if (shapedetector_shapedetectorcollection != null) {
|
||||
+ // CraftBukkit start - Use BlockStateListPopulator
|
||||
+ BlockStateListPopulator blockList = new BlockStateListPopulator(world);
|
||||
for (int i = 0; i < shapedetector.getWidth(); ++i) {
|
||||
for (int j = 0; j < shapedetector.getHeight(); ++j) {
|
||||
ShapeDetectorBlock shapedetectorblock = shapedetector_shapedetectorcollection.getBlock(i, j, 0);
|
||||
if (entitywither != null) {
|
||||
- BlockPumpkinCarved.clearPatternBlocks(world, shapedetector_shapedetectorcollection);
|
||||
+ // BlockPumpkinCarved.clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - move down
|
||||
BlockPosition blockposition1 = shapedetector_shapedetectorcollection.getBlock(1, 2, 0).getPos();
|
||||
|
||||
- world.setBlock(shapedetectorblock.getPos(), Blocks.AIR.defaultBlockState(), 2);
|
||||
- world.levelEvent(2001, shapedetectorblock.getPos(), Block.getId(shapedetectorblock.getState()));
|
||||
+ blockList.setBlock(shapedetectorblock.getPos(), Blocks.AIR.defaultBlockState(), 2); // CraftBukkit
|
||||
+ // world.levelEvent(2001, shapedetectorblock.getPos(), Block.getId(shapedetectorblock.getState())); // CraftBukkit
|
||||
entitywither.moveTo((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getForwards().getAxis() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F);
|
||||
entitywither.yBodyRot = shapedetector_shapedetectorcollection.getForwards().getAxis() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F;
|
||||
entitywither.makeInvulnerable();
|
||||
+ // CraftBukkit start
|
||||
+ if (!world.addFreshEntity(entitywither, SpawnReason.BUILD_WITHER)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ BlockPumpkinCarved.clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - from above
|
||||
+ // CraftBukkit end
|
||||
Iterator iterator = world.getEntitiesOfClass(EntityPlayer.class, entitywither.getBoundingBox().inflate(50.0D)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -74,7 +85,7 @@
|
||||
CriterionTriggers.SUMMONED_ENTITY.trigger(entityplayer, (Entity) entitywither);
|
||||
}
|
||||
|
||||
- world.addFreshEntity(entitywither);
|
||||
+ // world.addFreshEntity(entitywither); // CraftBukkit - moved up
|
||||
BlockPumpkinCarved.updatePatternBlocks(world, shapedetector_shapedetectorcollection);
|
||||
}
|
||||
|
||||
@@ -73,6 +81,15 @@
|
||||
entitywither.moveTo((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getForwards().getAxis() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F);
|
||||
entitywither.yBodyRot = shapedetector_shapedetectorcollection.getForwards().getAxis() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F;
|
||||
entitywither.makeInvulnerable();
|
||||
+ // CraftBukkit start
|
||||
+ if (!world.addFreshEntity(entitywither, SpawnReason.BUILD_WITHER)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ for (BlockPosition pos : blockList.getBlocks()) {
|
||||
+ world.levelEvent(2001, pos, Block.getId(world.getBlockState(pos)));
|
||||
+ }
|
||||
+ blockList.updateList();
|
||||
+ // CraftBukkit end
|
||||
Iterator iterator = world.getEntitiesOfClass(EntityPlayer.class, entitywither.getBoundingBox().inflate(50.0D)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -81,7 +98,7 @@
|
||||
CriterionTriggers.SUMMONED_ENTITY.trigger(entityplayer, (Entity) entitywither);
|
||||
}
|
||||
|
||||
- world.addFreshEntity(entitywither);
|
||||
+ // world.addFreshEntity(entitywither); // CraftBukkit - moved up
|
||||
|
||||
for (int k = 0; k < shapedetector.getWidth(); ++k) {
|
||||
for (int l = 0; l < shapedetector.getHeight(); ++l) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/CaveVinesBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CaveVinesBlock.java
|
||||
@@ -57,7 +57,7 @@
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
@Override
|
||||
public EnumInteractionResult use(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/CaveVinesPlantBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CaveVinesPlantBlock.java
|
||||
@@ -40,7 +40,7 @@
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
@Override
|
||||
public EnumInteractionResult use(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(LightningRodBlock.POWERED, true), 3);
|
||||
this.updateNeighbours(iblockdata, world, blockposition);
|
||||
world.scheduleTick(blockposition, (Block) this, 8);
|
||||
@@ -134,7 +151,7 @@
|
||||
Entity entity = iprojectile.getOwner();
|
||||
@@ -135,7 +152,7 @@
|
||||
Entity entity = iprojectile.getOwner();
|
||||
|
||||
entitylightning.setCause(entity instanceof EntityPlayer ? (EntityPlayer) entity : null);
|
||||
- world.addFreshEntity(entitylightning);
|
||||
+ ((WorldServer) world).strikeLightning(entitylightning, org.bukkit.event.weather.LightningStrikeEvent.Cause.TRIDENT); // CraftBukkit
|
||||
}
|
||||
|
||||
entitylightning.setCause(entity instanceof EntityPlayer ? (EntityPlayer) entity : null);
|
||||
- world.addFreshEntity(entitylightning);
|
||||
+ ((WorldServer) world).strikeLightning(entitylightning, org.bukkit.event.weather.LightningStrikeEvent.Cause.TRIDENT); // CraftBukkit
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.TRIDENT_THUNDER, SoundCategory.WEATHER, 5.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/SculkSensorBlock.java
|
||||
+++ b/net/minecraft/world/level/block/SculkSensorBlock.java
|
||||
@@ -42,6 +42,11 @@
|
||||
@@ -38,6 +38,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class SculkSensorBlock extends BlockTileEntity implements IBlockWaterlogged {
|
||||
|
||||
public static final int ACTIVE_TICKS = 40;
|
||||
@@ -135,6 +140,18 @@
|
||||
@@ -87,6 +92,18 @@
|
||||
@Override
|
||||
public void stepOn(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
|
||||
if (!world.isClientSide() && canActivate(iblockdata) && entity.getType() != EntityTypes.WARDEN) {
|
||||
@@ -31,7 +31,7 @@
|
||||
TileEntity tileentity = world.getBlockEntity(blockposition);
|
||||
|
||||
if (tileentity instanceof SculkSensorBlockEntity) {
|
||||
@@ -234,6 +251,15 @@
|
||||
@@ -188,6 +205,15 @@
|
||||
}
|
||||
|
||||
public static void deactivate(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
@@ -47,7 +47,7 @@
|
||||
world.setBlock(blockposition, (IBlockData) ((IBlockData) iblockdata.setValue(SculkSensorBlock.PHASE, SculkSensorPhase.COOLDOWN)).setValue(SculkSensorBlock.POWER, 0), 3);
|
||||
world.scheduleTick(blockposition, iblockdata.getBlock(), 1);
|
||||
if (!(Boolean) iblockdata.getValue(SculkSensorBlock.WATERLOGGED)) {
|
||||
@@ -244,6 +270,15 @@
|
||||
@@ -198,6 +224,15 @@
|
||||
}
|
||||
|
||||
public static void activate(@Nullable Entity entity, World world, BlockPosition blockposition, IBlockData iblockdata, int i) {
|
||||
@@ -63,7 +63,7 @@
|
||||
world.setBlock(blockposition, (IBlockData) ((IBlockData) iblockdata.setValue(SculkSensorBlock.PHASE, SculkSensorPhase.ACTIVE)).setValue(SculkSensorBlock.POWER, i), 3);
|
||||
world.scheduleTick(blockposition, iblockdata.getBlock(), 40);
|
||||
updateNeighbours(world, blockposition);
|
||||
@@ -306,9 +341,16 @@
|
||||
@@ -260,9 +295,16 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
--- a/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
||||
@@ -17,12 +17,54 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.List;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class ChiseledBookShelfBlockEntity extends TileEntity implements IInventory {
|
||||
|
||||
public static final int MAX_BOOKS_IN_STORAGE = 6;
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private final NonNullList<ItemStack> items;
|
||||
public int lastInteractedSlot;
|
||||
+ // CraftBukkit start - add fields and methods
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<>();
|
||||
+ private int maxStack = 1;
|
||||
+
|
||||
+ @Override
|
||||
+ public List<ItemStack> getContents() {
|
||||
+ return this.items;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onOpen(CraftHumanEntity who) {
|
||||
+ transaction.add(who);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onClose(CraftHumanEntity who) {
|
||||
+ transaction.remove(who);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<HumanEntity> getViewers() {
|
||||
+ return transaction;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setMaxStackSize(int size) {
|
||||
+ maxStack = size;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Location getLocation() {
|
||||
+ if (level == null) return null;
|
||||
+ return new org.bukkit.Location(level.getWorld(), worldPosition.getX(), worldPosition.getY(), worldPosition.getZ());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
public ChiseledBookShelfBlockEntity(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.CHISELED_BOOKSHELF, blockposition, iblockdata);
|
||||
@@ -113,7 +155,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxStackSize() {
|
||||
- return 1;
|
||||
+ return maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,5 +48,5 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
private NonNullList<ItemStack> items;
|
||||
public ContainerOpenersCounter openersCounter;
|
||||
public final ContainerOpenersCounter openersCounter;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
@@ -37,6 +37,11 @@
|
||||
@@ -38,6 +38,11 @@
|
||||
import net.minecraft.world.level.levelgen.HeightMap;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
+import org.bukkit.potion.PotionEffect;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class TileEntityBeacon extends TileEntity implements ITileInventory {
|
||||
public class TileEntityBeacon extends TileEntity implements ITileInventory, INamableTileEntity {
|
||||
|
||||
private static final int MAX_LEVELS = 4;
|
||||
@@ -59,6 +64,15 @@
|
||||
@@ -61,6 +66,15 @@
|
||||
public IChatBaseComponent name;
|
||||
public ChestLock lockKey;
|
||||
private final IContainerProperties dataAccess;
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
public TileEntityBeacon(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BEACON, blockposition, iblockdata);
|
||||
@@ -234,39 +248,78 @@
|
||||
@@ -236,39 +250,78 @@
|
||||
super.setRemoved();
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
public static void playSound(World world, BlockPosition blockposition, SoundEffect soundeffect) {
|
||||
world.playSound((EntityHuman) null, blockposition, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -295,8 +348,11 @@
|
||||
@@ -297,8 +350,11 @@
|
||||
@Override
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
super.load(nbttagcompound);
|
||||
|
||||
@@ -13,24 +13,24 @@
|
||||
public class TileEntityCampfire extends TileEntity implements Clearable {
|
||||
|
||||
private static final int BURN_COOL_SPEED = 2;
|
||||
@@ -58,6 +64,20 @@
|
||||
return recipecampfire.assemble(inventorysubcontainer);
|
||||
@@ -59,6 +65,20 @@
|
||||
}).orElse(itemstack);
|
||||
|
||||
+ // CraftBukkit start - fire BlockCookEvent
|
||||
+ CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
||||
+ org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
||||
if (itemstack1.isItemEnabled(world.enabledFeatures())) {
|
||||
+ // CraftBukkit start - fire BlockCookEvent
|
||||
+ CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
||||
+ org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
||||
+
|
||||
+ BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, blockposition), source, result);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(blockCookEvent);
|
||||
+ BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, blockposition), source, result);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(blockCookEvent);
|
||||
+
|
||||
+ if (blockCookEvent.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ if (blockCookEvent.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ result = blockCookEvent.getResult();
|
||||
+ itemstack1 = CraftItemStack.asNMSCopy(result);
|
||||
+ // CraftBukkit end
|
||||
InventoryUtils.dropItemStack(world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1);
|
||||
tileentitycampfire.items.set(i, ItemStack.EMPTY);
|
||||
world.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|
||||
+ result = blockCookEvent.getResult();
|
||||
+ itemstack1 = CraftItemStack.asNMSCopy(result);
|
||||
+ // CraftBukkit end
|
||||
InventoryUtils.dropItemStack(world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1);
|
||||
tileentitycampfire.items.set(i, ItemStack.EMPTY);
|
||||
world.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityContainer.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityContainer.java
|
||||
@@ -88,4 +88,12 @@
|
||||
@@ -89,4 +89,12 @@
|
||||
}
|
||||
|
||||
protected abstract Container createMenu(int i, PlayerInventory playerinventory);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
||||
@@ -32,6 +32,14 @@
|
||||
@@ -33,6 +33,14 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public class TileEntityEndGateway extends TileEntityEnderPortal {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -168,7 +176,7 @@
|
||||
@@ -169,7 +177,7 @@
|
||||
tileentityendgateway.teleportCooldown = 100;
|
||||
BlockPosition blockposition1;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
blockposition1 = findOrCreateValidTeleportPos(worldserver, blockposition);
|
||||
blockposition1 = blockposition1.above(10);
|
||||
TileEntityEndGateway.LOGGER.debug("Creating portal at {}", blockposition1);
|
||||
@@ -197,6 +205,27 @@
|
||||
@@ -198,6 +206,27 @@
|
||||
entity1 = entity.getRootVehicle();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
public static Map<Item, Integer> getFuel() {
|
||||
@@ -188,6 +202,40 @@
|
||||
@@ -182,6 +196,40 @@
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
private static boolean isNeverAFurnaceFuel(Item item) {
|
||||
return item.builtInRegistryHolder().is(TagsItem.NON_FLAMMABLE_WOOD);
|
||||
}
|
||||
@@ -276,7 +324,7 @@
|
||||
@@ -270,7 +318,7 @@
|
||||
IRecipe irecipe;
|
||||
|
||||
if (flag2) {
|
||||
@@ -80,7 +80,7 @@
|
||||
} else {
|
||||
irecipe = null;
|
||||
}
|
||||
@@ -284,9 +332,20 @@
|
||||
@@ -278,9 +326,20 @@
|
||||
int i = tileentityfurnace.getMaxStackSize();
|
||||
|
||||
if (!tileentityfurnace.isLit() && canBurn(irecipe, tileentityfurnace.items, i)) {
|
||||
@@ -103,7 +103,7 @@
|
||||
flag1 = true;
|
||||
if (flag3) {
|
||||
Item item = itemstack.getItem();
|
||||
@@ -302,11 +361,23 @@
|
||||
@@ -296,11 +355,23 @@
|
||||
}
|
||||
|
||||
if (tileentityfurnace.isLit() && canBurn(irecipe, tileentityfurnace.items, i)) {
|
||||
@@ -128,7 +128,7 @@
|
||||
tileentityfurnace.setRecipeUsed(irecipe);
|
||||
}
|
||||
|
||||
@@ -345,17 +416,44 @@
|
||||
@@ -339,17 +410,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
if (itemstack.is(Blocks.WET_SPONGE.asItem()) && !((ItemStack) nonnulllist.get(1)).isEmpty() && ((ItemStack) nonnulllist.get(1)).is(Items.BUCKET)) {
|
||||
nonnulllist.set(1, new ItemStack(Items.WATER_BUCKET));
|
||||
@@ -379,7 +477,7 @@
|
||||
@@ -373,7 +471,7 @@
|
||||
}
|
||||
|
||||
private static int getTotalCookTime(World world, TileEntityFurnace tileentityfurnace) {
|
||||
@@ -183,7 +183,7 @@
|
||||
}
|
||||
|
||||
public static boolean isFuel(ItemStack itemstack) {
|
||||
@@ -498,14 +596,20 @@
|
||||
@@ -492,14 +590,20 @@
|
||||
@Override
|
||||
public void awardUsedRecipes(EntityHuman entityhuman) {}
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
List<IRecipe<?>> list = Lists.newArrayList();
|
||||
ObjectIterator objectiterator = this.recipesUsed.object2IntEntrySet().iterator();
|
||||
|
||||
@@ -514,14 +618,14 @@
|
||||
@@ -508,14 +612,14 @@
|
||||
|
||||
worldserver.getRecipeManager().byKey((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
|
||||
list.add(irecipe);
|
||||
@@ -223,7 +223,7 @@
|
||||
int j = MathHelper.floor((float) i * f);
|
||||
float f1 = MathHelper.frac((float) i * f);
|
||||
|
||||
@@ -529,6 +633,17 @@
|
||||
@@ -523,6 +627,17 @@
|
||||
++j;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
this.level.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_OPEN, this.worldPosition);
|
||||
@@ -175,6 +212,7 @@
|
||||
public void stopOpen(EntityHuman entityhuman) {
|
||||
if (!entityhuman.isSpectator()) {
|
||||
if (!this.remove && !entityhuman.isSpectator()) {
|
||||
--this.openCount;
|
||||
+ if (opened) return; // CraftBukkit - only animate if the ShulkerBox hasn't been forced open already by an API call.
|
||||
this.level.blockEvent(this.worldPosition, this.getBlockState().getBlock(), 1, this.openCount);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntitySign.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntitySign.java
|
||||
@@ -24,7 +24,7 @@
|
||||
@@ -25,7 +25,7 @@
|
||||
import net.minecraft.world.phys.Vec2F;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+public class TileEntitySign extends TileEntity implements ICommandListener { // CraftBukkit - implements
|
||||
|
||||
public static final int LINES = 4;
|
||||
private static final String[] RAW_TEXT_FIELD_NAMES = new String[]{"Text1", "Text2", "Text3", "Text4"};
|
||||
@@ -64,6 +64,12 @@
|
||||
private static final int MAX_TEXT_LINE_WIDTH = 90;
|
||||
@@ -83,6 +83,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
nbttagcompound.putString("Color", this.color.getName());
|
||||
nbttagcompound.putBoolean("GlowingText", this.hasGlowingText);
|
||||
}
|
||||
@@ -74,8 +80,24 @@
|
||||
@@ -93,8 +99,24 @@
|
||||
super.load(nbttagcompound);
|
||||
this.color = EnumColor.byName(nbttagcompound.getString("Color"), EnumColor.BLACK);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
IChatBaseComponent ichatbasecomponent = this.loadLine(s);
|
||||
|
||||
this.messages[i] = ichatbasecomponent;
|
||||
@@ -113,6 +135,10 @@
|
||||
@@ -132,6 +154,10 @@
|
||||
if (ichatmutablecomponent != null) {
|
||||
return ichatmutablecomponent;
|
||||
}
|
||||
@@ -58,7 +58,7 @@
|
||||
} catch (Exception exception) {
|
||||
;
|
||||
}
|
||||
@@ -204,11 +230,37 @@
|
||||
@@ -240,11 +266,37 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
public EnumColor getColor() {
|
||||
@@ -241,6 +293,6 @@
|
||||
@@ -277,6 +329,6 @@
|
||||
|
||||
private void markUpdated() {
|
||||
this.setChanged();
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
--- a/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
|
||||
+++ b/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
|
||||
@@ -38,6 +38,7 @@
|
||||
if (holder == null) {
|
||||
@@ -40,11 +40,12 @@
|
||||
if (resourcekey == null) {
|
||||
return false;
|
||||
} else {
|
||||
+ setTreeType(holder); // CraftBukkit
|
||||
WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured = (WorldGenFeatureConfigured) holder.value();
|
||||
IBlockData iblockdata1 = Blocks.AIR.defaultBlockState();
|
||||
- Holder<WorldGenFeatureConfigured<?, ?>> holder = (Holder) worldserver.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse((Object) null);
|
||||
+ Holder<WorldGenFeatureConfigured<?, ?>> holder = (Holder) worldserver.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse(null); // CraftBukkit - decompile error
|
||||
|
||||
if (holder == null) {
|
||||
return false;
|
||||
} else {
|
||||
+ setTreeType(holder); // CraftBukkit
|
||||
WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured = (WorldGenFeatureConfigured) holder.value();
|
||||
IBlockData iblockdata1 = Blocks.AIR.defaultBlockState();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
|
||||
+++ b/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
|
||||
@@ -12,6 +12,12 @@
|
||||
@@ -14,6 +14,12 @@
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.WorldGenFeatureConfigured;
|
||||
|
||||
@@ -13,21 +13,28 @@
|
||||
public abstract class WorldGenTreeProvider {
|
||||
|
||||
public WorldGenTreeProvider() {}
|
||||
@@ -25,6 +31,7 @@
|
||||
if (holder == null) {
|
||||
@@ -27,11 +33,12 @@
|
||||
if (resourcekey == null) {
|
||||
return false;
|
||||
} else {
|
||||
+ setTreeType(holder); // CraftBukkit
|
||||
WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured = (WorldGenFeatureConfigured) holder.value();
|
||||
IBlockData iblockdata1 = worldserver.getFluidState(blockposition).createLegacyBlock();
|
||||
- Holder<WorldGenFeatureConfigured<?, ?>> holder = (Holder) worldserver.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse((Object) null);
|
||||
+ Holder<WorldGenFeatureConfigured<?, ?>> holder = (Holder) worldserver.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse(null); // CraftBukkit - decompile error
|
||||
|
||||
@@ -57,4 +64,52 @@
|
||||
if (holder == null) {
|
||||
return false;
|
||||
} else {
|
||||
+ setTreeType(holder); // CraftBukkit
|
||||
WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured = (WorldGenFeatureConfigured) holder.value();
|
||||
IBlockData iblockdata1 = worldserver.getFluidState(blockposition).createLegacyBlock();
|
||||
|
||||
@@ -65,4 +72,53 @@
|
||||
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ protected void setTreeType(Holder<? extends WorldGenFeatureConfigured<?, ?>> worldgentreeabstract) {
|
||||
+ protected void setTreeType(Holder<WorldGenFeatureConfigured<?, ?>> holder) {
|
||||
+ ResourceKey<WorldGenFeatureConfigured<?, ?>> worldgentreeabstract = holder.unwrapKey().get();
|
||||
+ if (worldgentreeabstract == TreeFeatures.OAK || worldgentreeabstract == TreeFeatures.OAK_BEES_005) {
|
||||
+ BlockSapling.treeType = TreeType.TREE;
|
||||
+ } else if (worldgentreeabstract == TreeFeatures.HUGE_RED_MUSHROOM) {
|
||||
|
||||
Reference in New Issue
Block a user