@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/Explosion.java
|
||||
+++ b/net/minecraft/world/level/Explosion.java
|
||||
@@ -40,6 +40,15 @@
|
||||
@@ -41,6 +41,15 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
public class Explosion {
|
||||
|
||||
private static final ExplosionDamageCalculator EXPLOSION_DAMAGE_CALCULATOR = new ExplosionDamageCalculator();
|
||||
@@ -58,6 +67,7 @@
|
||||
@@ -59,6 +68,7 @@
|
||||
private final ExplosionDamageCalculator damageCalculator;
|
||||
private final ObjectArrayList<BlockPosition> toBlow;
|
||||
private final Map<EntityHuman, Vec3D> hitPlayers;
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
public Explosion(World world, @Nullable Entity entity, double d0, double d1, double d2, float f, List<BlockPosition> list) {
|
||||
this(world, entity, d0, d1, d2, f, false, Explosion.Effect.DESTROY_WITH_DECAY, list);
|
||||
@@ -78,7 +88,7 @@
|
||||
@@ -79,7 +89,7 @@
|
||||
this.hitPlayers = Maps.newHashMap();
|
||||
this.level = world;
|
||||
this.source = entity;
|
||||
@@ -33,7 +33,7 @@
|
||||
this.x = d0;
|
||||
this.y = d1;
|
||||
this.z = d2;
|
||||
@@ -128,6 +138,11 @@
|
||||
@@ -129,6 +139,11 @@
|
||||
}
|
||||
|
||||
public void explode() {
|
||||
@@ -45,7 +45,7 @@
|
||||
this.level.gameEvent(this.source, GameEvent.EXPLODE, new Vec3D(this.x, this.y, this.z));
|
||||
Set<BlockPosition> set = Sets.newHashSet();
|
||||
boolean flag = true;
|
||||
@@ -211,7 +226,39 @@
|
||||
@@ -213,7 +228,39 @@
|
||||
double d12 = (double) getSeenPercent(vec3d, entity);
|
||||
double d13 = (1.0D - d7) * d12;
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
double d14;
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
@@ -263,11 +310,66 @@
|
||||
@@ -265,11 +312,66 @@
|
||||
|
||||
SystemUtils.shuffle(this.toBlow, this.level.random);
|
||||
ObjectListIterator objectlistiterator = this.toBlow.iterator();
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
if (!iblockdata.isAir()) {
|
||||
BlockPosition blockposition1 = blockposition.immutable();
|
||||
@@ -281,8 +383,8 @@
|
||||
@@ -283,8 +385,8 @@
|
||||
TileEntity tileentity = iblockdata.hasBlockEntity() ? this.level.getBlockEntity(blockposition) : null;
|
||||
LootParams.a lootparams_a = (new LootParams.a(worldserver)).withParameter(LootContextParameters.ORIGIN, Vec3D.atCenterOf(blockposition)).withParameter(LootContextParameters.TOOL, ItemStack.EMPTY).withOptionalParameter(LootContextParameters.BLOCK_ENTITY, tileentity).withOptionalParameter(LootContextParameters.THIS_ENTITY, this.source);
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
}
|
||||
|
||||
iblockdata.spawnAfterBreak(worldserver, blockposition, ItemStack.EMPTY, flag2);
|
||||
@@ -314,7 +416,11 @@
|
||||
@@ -316,7 +418,11 @@
|
||||
BlockPosition blockposition2 = (BlockPosition) objectlistiterator1.next();
|
||||
|
||||
if (this.random.nextInt(3) == 0 && this.level.getBlockState(blockposition2).isAir() && this.level.getBlockState(blockposition2.below()).isSolidRender(this.level, blockposition2.below())) {
|
||||
@@ -177,7 +177,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,6 +432,7 @@
|
||||
@@ -328,6 +434,7 @@
|
||||
}
|
||||
|
||||
private static void addBlockDrops(ObjectArrayList<Pair<ItemStack, BlockPosition>> objectarraylist, ItemStack itemstack, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/GameRules.java
|
||||
+++ b/net/minecraft/world/level/GameRules.java
|
||||
@@ -128,7 +128,7 @@
|
||||
@@ -138,7 +138,7 @@
|
||||
}
|
||||
|
||||
public <T extends GameRules.GameRuleValue<T>> T getRule(GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
public NBTTagCompound createTag() {
|
||||
@@ -142,7 +142,7 @@
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
private void loadFromTag(DynamicLike<?> dynamiclike) {
|
||||
this.rules.forEach((gamerules_gamerulekey, gamerules_gamerulevalue) -> {
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
Objects.requireNonNull(gamerules_gamerulevalue);
|
||||
optional.ifPresent(gamerules_gamerulevalue::deserialize);
|
||||
@@ -162,8 +162,8 @@
|
||||
@@ -172,8 +172,8 @@
|
||||
}
|
||||
|
||||
private static <T extends GameRules.GameRuleValue<T>> void callVisitorCap(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<?> gamerules_gamerulekey, GameRules.GameRuleDefinition<?> gamerules_gameruledefinition) {
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
public void assignFrom(GameRules gamerules, @Nullable MinecraftServer minecraftserver) {
|
||||
@@ -255,7 +255,7 @@
|
||||
@@ -265,7 +265,7 @@
|
||||
}
|
||||
|
||||
public T createRule() {
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
public void callVisitor(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
||||
@@ -285,7 +285,7 @@
|
||||
@@ -295,7 +295,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
public abstract String serialize();
|
||||
|
||||
@@ -351,7 +351,7 @@
|
||||
@@ -361,7 +361,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,7 +56,7 @@
|
||||
this.value = Boolean.parseBoolean(s);
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@
|
||||
@@ -426,7 +426,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBeehive.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBeehive.java
|
||||
@@ -105,7 +105,7 @@
|
||||
EntityBee entitybee = (EntityBee) iterator.next();
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
if (entitybee.getTarget() == null) {
|
||||
- entitybee.setTarget((EntityLiving) list1.get(world.random.nextInt(i)));
|
||||
+ entitybee.setTarget((EntityLiving) list1.get(world.random.nextInt(i)), org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit
|
||||
EntityHuman entityhuman = (EntityHuman) SystemUtils.getRandom(list1, world.random);
|
||||
|
||||
- entitybee.setTarget(entityhuman);
|
||||
+ entitybee.setTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,4 +331,16 @@
|
||||
@@ -338,4 +338,16 @@
|
||||
|
||||
return super.updateShape(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCampfire.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCampfire.java
|
||||
@@ -46,6 +46,10 @@
|
||||
@@ -47,6 +47,10 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged {
|
||||
|
||||
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
@@ -90,7 +94,9 @@
|
||||
@@ -91,7 +95,9 @@
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if ((Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
super.entityInside(iblockdata, world, blockposition, entity);
|
||||
@@ -200,6 +206,11 @@
|
||||
@@ -201,6 +207,11 @@
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||
|
||||
if (!world.isClientSide && iprojectile.isOnFire() && iprojectile.mayInteract(world, blockposition) && !(Boolean) iblockdata.getValue(BlockCampfire.LIT) && !(Boolean) iblockdata.getValue(BlockCampfire.WATERLOGGED)) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/world/level/block/BlockChorusFlower.java
|
||||
+++ b/net/minecraft/world/level/block/BlockChorusFlower.java
|
||||
@@ -18,6 +18,8 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateInteger;
|
||||
@@ -20,6 +20,8 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+
|
||||
public class BlockChorusFlower extends Block {
|
||||
|
||||
public static final int DEAD_AGE = 5;
|
||||
@@ -82,8 +84,12 @@
|
||||
@@ -90,8 +92,12 @@
|
||||
}
|
||||
|
||||
if (flag && allNeighborsEmpty(worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmptyBlock(blockposition.above(2))) {
|
||||
@@ -24,7 +24,7 @@
|
||||
} else if (i < 4) {
|
||||
j = randomsource.nextInt(4);
|
||||
if (flag1) {
|
||||
@@ -97,18 +103,30 @@
|
||||
@@ -105,18 +111,30 @@
|
||||
BlockPosition blockposition2 = blockposition.relative(enumdirection);
|
||||
|
||||
if (worldserver.isEmptyBlock(blockposition2) && worldserver.isEmptyBlock(blockposition2.below()) && allNeighborsEmpty(worldserver, blockposition2, enumdirection.getOpposite())) {
|
||||
@@ -59,7 +59,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -245,6 +263,11 @@
|
||||
@@ -253,6 +271,11 @@
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||
|
||||
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile.getType().is(TagsEntity.IMPACT_PROJECTILES)) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
protected int getBonemealAgeIncrease(World world) {
|
||||
@@ -149,7 +151,7 @@
|
||||
@@ -153,7 +155,7 @@
|
||||
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
||||
|
||||
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
|
||||
@@ -46,8 +48,18 @@
|
||||
@@ -52,8 +54,18 @@
|
||||
boolean flag1 = this.shouldTurnOn(worldserver, blockposition, iblockdata);
|
||||
|
||||
if (flag && !flag1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDispenser.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDispenser.java
|
||||
@@ -46,6 +46,7 @@
|
||||
@@ -48,6 +48,7 @@
|
||||
object2objectopenhashmap.defaultReturnValue(new DispenseBehaviorItem());
|
||||
});
|
||||
private static final int TRIGGER_DURATION = 4;
|
||||
@@ -8,11 +8,20 @@
|
||||
|
||||
public static void registerBehavior(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
|
||||
BlockDispenser.DISPENSER_REGISTRY.put(imaterial.asItem(), idispensebehavior);
|
||||
@@ -89,6 +90,7 @@
|
||||
IDispenseBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
||||
@@ -79,7 +80,7 @@
|
||||
}
|
||||
|
||||
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
||||
+ eventFired = false; // CraftBukkit - reset event status
|
||||
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
|
||||
}
|
||||
public void dispenseFrom(WorldServer worldserver, IBlockData iblockdata, BlockPosition blockposition) {
|
||||
- TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DISPENSER).orElse((Object) null);
|
||||
+ TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DISPENSER).orElse(null); // CraftBukkit - decompile error
|
||||
|
||||
if (tileentitydispenser == null) {
|
||||
BlockDispenser.LOGGER.warn("Ignoring dispensing attempt for Dispenser without matching block entity at {}", blockposition);
|
||||
@@ -95,6 +96,7 @@
|
||||
IDispenseBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
||||
|
||||
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
||||
+ eventFired = false; // CraftBukkit - reset event status
|
||||
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDropper.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDropper.java
|
||||
@@ -15,9 +15,15 @@
|
||||
import net.minecraft.world.level.block.state.BlockBase;
|
||||
@@ -18,10 +18,16 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.InventoryLargeChest;
|
||||
@@ -12,36 +12,46 @@
|
||||
+
|
||||
public class BlockDropper extends BlockDispenser {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
- private static final IDispenseBehavior DISPENSE_BEHAVIOUR = new DispenseBehaviorItem();
|
||||
+ private static final IDispenseBehavior DISPENSE_BEHAVIOUR = new DispenseBehaviorItem(true); // CraftBukkit
|
||||
|
||||
public BlockDropper(BlockBase.Info blockbase_info) {
|
||||
super(blockbase_info);
|
||||
@@ -52,8 +58,25 @@
|
||||
if (iinventory == null) {
|
||||
itemstack1 = BlockDropper.DISPENSE_BEHAVIOUR.dispense(sourceblock, itemstack);
|
||||
} else {
|
||||
- itemstack1 = TileEntityHopper.addItem(tileentitydispenser, iinventory, itemstack.copy().split(1), enumdirection.getOpposite());
|
||||
- if (itemstack1.isEmpty()) {
|
||||
+ // CraftBukkit start - Fire event when pushing items into other inventories
|
||||
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(itemstack.copy().split(1));
|
||||
+
|
||||
+ org.bukkit.inventory.Inventory destinationInventory;
|
||||
+ // Have to special case large chests as they work oddly
|
||||
+ if (iinventory instanceof InventoryLargeChest) {
|
||||
+ destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) iinventory);
|
||||
+ } else {
|
||||
+ destinationInventory = iinventory.getOwner().getInventory();
|
||||
+ }
|
||||
+
|
||||
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(tileentitydispenser.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true);
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ itemstack1 = TileEntityHopper.addItem(tileentitydispenser, iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection.getOpposite());
|
||||
+ if (event.getItem().equals(oitemstack) && itemstack1.isEmpty()) {
|
||||
+ // CraftBukkit end
|
||||
itemstack1 = itemstack.copy();
|
||||
itemstack1.shrink(1);
|
||||
@@ -39,7 +45,7 @@
|
||||
|
||||
@Override
|
||||
public void dispenseFrom(WorldServer worldserver, IBlockData iblockdata, BlockPosition blockposition) {
|
||||
- TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DROPPER).orElse((Object) null);
|
||||
+ TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DROPPER).orElse(null); // CraftBukkit - decompile error
|
||||
|
||||
if (tileentitydispenser == null) {
|
||||
BlockDropper.LOGGER.warn("Ignoring dispensing attempt for Dropper without matching block entity at {}", blockposition);
|
||||
@@ -60,8 +66,25 @@
|
||||
if (iinventory == null) {
|
||||
itemstack1 = BlockDropper.DISPENSE_BEHAVIOUR.dispense(sourceblock, itemstack);
|
||||
} else {
|
||||
- itemstack1 = TileEntityHopper.addItem(tileentitydispenser, iinventory, itemstack.copy().split(1), enumdirection.getOpposite());
|
||||
- if (itemstack1.isEmpty()) {
|
||||
+ // CraftBukkit start - Fire event when pushing items into other inventories
|
||||
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(itemstack.copy().split(1));
|
||||
+
|
||||
+ org.bukkit.inventory.Inventory destinationInventory;
|
||||
+ // Have to special case large chests as they work oddly
|
||||
+ if (iinventory instanceof InventoryLargeChest) {
|
||||
+ destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) iinventory);
|
||||
+ } else {
|
||||
+ destinationInventory = iinventory.getOwner().getInventory();
|
||||
+ }
|
||||
+
|
||||
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(tileentitydispenser.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true);
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ itemstack1 = TileEntityHopper.addItem(tileentitydispenser, iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection.getOpposite());
|
||||
+ if (event.getItem().equals(oitemstack) && itemstack1.isEmpty()) {
|
||||
+ // CraftBukkit end
|
||||
itemstack1 = itemstack.copy();
|
||||
itemstack1.shrink(1);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFluids.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFluids.java
|
||||
@@ -140,14 +140,20 @@
|
||||
@@ -142,14 +142,20 @@
|
||||
if (world.getFluidState(blockposition1).is(TagsFluid.WATER)) {
|
||||
Block block = world.getFluidState(blockposition).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockRedstoneComparator.java
|
||||
+++ b/net/minecraft/world/level/block/BlockRedstoneComparator.java
|
||||
@@ -26,6 +26,8 @@
|
||||
@@ -27,6 +27,8 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.ticks.TickListPriority;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity {
|
||||
|
||||
public static final BlockStateEnum<BlockPropertyComparatorMode> MODE = BlockProperties.MODE_COMPARATOR;
|
||||
@@ -97,7 +99,8 @@
|
||||
@@ -103,7 +105,8 @@
|
||||
|
||||
@Nullable
|
||||
private EntityItemFrame getItemFrame(World world, EnumDirection enumdirection, BlockPosition blockposition) {
|
||||
@@ -19,7 +19,7 @@
|
||||
return entityitemframe != null && entityitemframe.getDirection() == enumdirection;
|
||||
});
|
||||
|
||||
@@ -152,8 +155,18 @@
|
||||
@@ -158,8 +161,18 @@
|
||||
boolean flag1 = (Boolean) iblockdata.getValue(BlockRedstoneComparator.POWERED);
|
||||
|
||||
if (flag1 && !flag) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockRedstoneTorch.java
|
||||
+++ b/net/minecraft/world/level/block/BlockRedstoneTorch.java
|
||||
@@ -17,6 +17,8 @@
|
||||
@@ -18,6 +18,8 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockProperties;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockRedstoneTorch extends BlockTorch {
|
||||
|
||||
public static final BlockStateBoolean LIT = BlockProperties.LIT;
|
||||
@@ -77,8 +79,24 @@
|
||||
@@ -78,8 +80,24 @@
|
||||
list.remove(0);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockRedstoneTorch.LIT, false), 3);
|
||||
if (isToggledTooFrequently(worldserver, blockposition, true)) {
|
||||
worldserver.levelEvent(1502, blockposition, 0);
|
||||
@@ -86,6 +104,15 @@
|
||||
@@ -87,6 +105,15 @@
|
||||
}
|
||||
}
|
||||
} else if (!flag && !isToggledTooFrequently(worldserver, blockposition, false)) {
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
} else if (!this.otherPlayerIsEditingSign(entityhuman, tileentitysign) && entityhuman.mayBuild() && this.hasEditableText(entityhuman, tileentitysign, flag1)) {
|
||||
- this.openTextEdit(entityhuman, tileentitysign, flag1);
|
||||
+ this.openTextEdit(entityhuman, tileentitysign, flag1, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
return this.getInteractionResult(flag);
|
||||
} else {
|
||||
return EnumInteractionResult.PASS;
|
||||
@@ -164,6 +164,15 @@
|
||||
@@ -168,6 +168,15 @@
|
||||
}
|
||||
|
||||
public void openTextEdit(EntityHuman entityhuman, TileEntitySign tileentitysign, boolean flag) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockSponge.java
|
||||
+++ b/net/minecraft/world/level/block/BlockSponge.java
|
||||
@@ -9,6 +9,13 @@
|
||||
@@ -12,6 +12,13 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class BlockSponge extends Block {
|
||||
|
||||
public static final int MAX_DEPTH = 6;
|
||||
@@ -41,7 +48,8 @@
|
||||
@@ -44,7 +51,8 @@
|
||||
}
|
||||
|
||||
private boolean removeWaterBreadthFirstSearch(World world, BlockPosition blockposition) {
|
||||
@@ -24,7 +24,7 @@
|
||||
EnumDirection[] aenumdirection = BlockSponge.ALL_DIRECTIONS;
|
||||
int i = aenumdirection.length;
|
||||
|
||||
@@ -55,8 +63,10 @@
|
||||
@@ -58,8 +66,10 @@
|
||||
if (blockposition1.equals(blockposition)) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -37,12 +37,12 @@
|
||||
|
||||
if (!fluid.is(TagsFluid.WATER)) {
|
||||
return false;
|
||||
@@ -66,27 +76,64 @@
|
||||
@@ -69,27 +79,64 @@
|
||||
if (block instanceof IFluidSource) {
|
||||
IFluidSource ifluidsource = (IFluidSource) block;
|
||||
|
||||
- if (!ifluidsource.pickupBlock(world, blockposition1, iblockdata).isEmpty()) {
|
||||
+ if (!ifluidsource.pickupBlock(blockList, blockposition1, iblockdata).isEmpty()) { // CraftBukkit
|
||||
- if (!ifluidsource.pickupBlock((EntityHuman) null, world, blockposition1, iblockdata).isEmpty()) {
|
||||
+ if (!ifluidsource.pickupBlock((EntityHuman) null, blockList, blockposition1, iblockdata).isEmpty()) { // CraftBukkit
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@
|
||||
+ Fluid fluid = world.getFluidState(blockposition1);
|
||||
+
|
||||
+ if (fluid.is(TagsFluid.WATER)) {
|
||||
+ if (iblockdata.getBlock() instanceof IFluidSource && !((IFluidSource) iblockdata.getBlock()).pickupBlock(blockList, blockposition1, iblockdata).isEmpty()) {
|
||||
+ if (iblockdata.getBlock() instanceof IFluidSource && !((IFluidSource) iblockdata.getBlock()).pickupBlock((EntityHuman) null, blockList, blockposition1, iblockdata).isEmpty()) {
|
||||
+ // NOP
|
||||
+ } else if (iblockdata.getBlock() instanceof BlockFluids) {
|
||||
+ // NOP
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
this.decreaseEggs(world, blockposition, iblockdata);
|
||||
}
|
||||
|
||||
@@ -91,9 +110,19 @@
|
||||
@@ -91,10 +110,20 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockTurtleEgg.HATCH);
|
||||
|
||||
if (i < 2) {
|
||||
@@ -45,6 +45,7 @@
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_CRACK, SoundCategory.BLOCKS, 0.7F, 0.9F + randomsource.nextFloat() * 0.2F);
|
||||
- worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockTurtleEgg.HATCH, i + 1), 2);
|
||||
+ // worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockTurtleEgg.HATCH, i + 1), 2); // CraftBukkit - handled above
|
||||
worldserver.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata));
|
||||
} else {
|
||||
+ // CraftBukkit start - Call BlockFadeEvent
|
||||
+ if (CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
||||
@@ -53,8 +54,8 @@
|
||||
+ // CraftBukkit end
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + randomsource.nextFloat() * 0.2F);
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
|
||||
@@ -105,7 +134,7 @@
|
||||
worldserver.gameEvent(GameEvent.BLOCK_DESTROY, blockposition, GameEvent.a.of(iblockdata));
|
||||
@@ -107,7 +136,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);
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
--- a/net/minecraft/world/level/block/ChiseledBookShelfBlock.java
|
||||
+++ b/net/minecraft/world/level/block/ChiseledBookShelfBlock.java
|
||||
@@ -128,7 +128,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- private static int getHitSlot(Vec2F vec2f) {
|
||||
+ public static int getHitSlot(Vec2F vec2f) { //CraftBukkit - private -> public
|
||||
int i = vec2f.y >= 0.5F ? 0 : 1;
|
||||
int j = getSection(vec2f.x);
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
Objects.requireNonNull(blockstatelist_a);
|
||||
list.forEach((iblockstate) -> {
|
||||
- blockstatelist_a.add(iblockstate);
|
||||
+ blockstatelist_a.add((BlockStateBoolean) iblockstate); // CraftBukkit - Decompile error
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/PowderSnowBlock.java
|
||||
+++ b/net/minecraft/world/level/block/PowderSnowBlock.java
|
||||
@@ -69,7 +69,12 @@
|
||||
@@ -70,7 +70,12 @@
|
||||
|
||||
entity.setIsInPowderSnow(true);
|
||||
if (!world.isClientSide) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- 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;
|
||||
@@ -18,12 +18,54 @@
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
public ChiseledBookShelfBlockEntity(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.CHISELED_BOOKSHELF, blockposition, iblockdata);
|
||||
@@ -50,6 +92,7 @@
|
||||
@@ -52,6 +94,7 @@
|
||||
|
||||
@Override
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
@@ -63,7 +63,7 @@
|
||||
this.items.clear();
|
||||
ContainerUtil.loadAllItems(nbttagcompound, this.items);
|
||||
this.lastInteractedSlot = nbttagcompound.getInt("last_interacted_slot");
|
||||
@@ -91,7 +134,7 @@
|
||||
@@ -93,7 +136,7 @@
|
||||
|
||||
this.items.set(i, ItemStack.EMPTY);
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -72,16 +72,16 @@
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
@@ -106,7 +149,7 @@
|
||||
@@ -108,7 +151,7 @@
|
||||
public void setItem(int i, ItemStack itemstack) {
|
||||
if (itemstack.is(TagsItem.BOOKSHELF_BOOKS)) {
|
||||
this.items.set(i, itemstack);
|
||||
- this.updateState(i);
|
||||
+ if (level != null) this.updateState(i); // CraftBukkit - SPIGOT-7381: check for null world
|
||||
} else if (itemstack.isEmpty()) {
|
||||
this.removeItem(i, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -120,7 +163,7 @@
|
||||
@@ -124,7 +167,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxStackSize() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -32,14 +32,18 @@
|
||||
public SculkCatalystBlockEntity(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.SCULK_CATALYST, blockposition, iblockdata);
|
||||
this.catalystListener = new SculkCatalystBlockEntity.a(iblockdata, new BlockPositionSource(blockposition));
|
||||
this.catalystListener = new SculkCatalystBlockEntity.CatalystListener(iblockdata, new BlockPositionSource(blockposition));
|
||||
+ catalystListener.level = level; // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -25,14 +25,5 @@
|
||||
private final PositionSource positionSource;
|
||||
+ private World level; // CraftBukkit
|
||||
|
||||
public a(IBlockData iblockdata, PositionSource positionsource) {
|
||||
public CatalystListener(IBlockData iblockdata, PositionSource positionsource) {
|
||||
this.blockState = iblockdata;
|
||||
@@ -116,7 +121,7 @@
|
||||
return this.sculkSpreader;
|
||||
}
|
||||
|
||||
- private void bloom(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, RandomSource randomsource) {
|
||||
+ public void bloom(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, RandomSource randomsource) {
|
||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(SculkCatalystBlock.PULSE, true), 3);
|
||||
worldserver.scheduleTick(blockposition, iblockdata.getBlock(), 8);
|
||||
worldserver.sendParticles(Particles.SCULK_SOUL, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 1.15D, (double) blockposition.getZ() + 0.5D, 2, 0.2D, 0.0D, 0.2D, 0.0D);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
@@ -38,6 +38,11 @@
|
||||
@@ -40,6 +40,11 @@
|
||||
import net.minecraft.world.level.levelgen.HeightMap;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class TileEntityBeacon extends TileEntity implements ITileInventory, INamableTileEntity {
|
||||
|
||||
private static final int MAX_LEVELS = 4;
|
||||
@@ -61,6 +66,15 @@
|
||||
@@ -65,6 +70,15 @@
|
||||
public IChatBaseComponent name;
|
||||
public ChestLock lockKey;
|
||||
private final IContainerProperties dataAccess;
|
||||
@@ -26,9 +26,9 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
public TileEntityBeacon(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BEACON, blockposition, iblockdata);
|
||||
@@ -236,39 +250,78 @@
|
||||
@Nullable
|
||||
static MobEffectList filterEffect(@Nullable MobEffectList mobeffectlist) {
|
||||
@@ -245,39 +259,78 @@
|
||||
super.setRemoved();
|
||||
}
|
||||
|
||||
@@ -117,17 +117,20 @@
|
||||
public static void playSound(World world, BlockPosition blockposition, SoundEffect soundeffect) {
|
||||
world.playSound((EntityHuman) null, blockposition, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -297,8 +350,11 @@
|
||||
@Override
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
@@ -312,7 +365,7 @@
|
||||
if (nbttagcompound.contains(s, 8)) {
|
||||
MinecraftKey minecraftkey = MinecraftKey.tryParse(nbttagcompound.getString(s));
|
||||
|
||||
- return filterEffect((MobEffectList) BuiltInRegistries.MOB_EFFECT.get(minecraftkey));
|
||||
+ return (MobEffectList) BuiltInRegistries.MOB_EFFECT.get(minecraftkey); // CraftBukkit - persist manually set non-default beacon effects (SPIGOT-3598)
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -323,6 +376,7 @@
|
||||
super.load(nbttagcompound);
|
||||
- this.primaryPower = getValidEffectById(nbttagcompound.getInt("Primary"));
|
||||
- this.secondaryPower = getValidEffectById(nbttagcompound.getInt("Secondary"));
|
||||
+ // CraftBukkit start - persist manually set non-default beacon effects (SPIGOT-3598)
|
||||
+ this.primaryPower = MobEffectList.byId(nbttagcompound.getInt("Primary"));
|
||||
+ this.secondaryPower = MobEffectList.byId(nbttagcompound.getInt("Secondary"));
|
||||
+ this.levels = nbttagcompound.getInt("Levels"); // SPIGOT-5053, use where available
|
||||
+ // CraftBukkit end
|
||||
this.primaryPower = loadEffect(nbttagcompound, "primary_effect");
|
||||
this.secondaryPower = loadEffect(nbttagcompound, "secondary_effect");
|
||||
+ this.levels = nbttagcompound.getInt("Levels"); // CraftBukkit - SPIGOT-5053, use where available
|
||||
if (nbttagcompound.contains("CustomName", 8)) {
|
||||
this.name = IChatBaseComponent.ChatSerializer.fromJson(nbttagcompound.getString("CustomName"));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
||||
@@ -25,6 +25,14 @@
|
||||
@@ -26,6 +26,14 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public class TileEntityCampfire extends TileEntity implements Clearable {
|
||||
|
||||
private static final int BURN_COOL_SPEED = 2;
|
||||
@@ -59,6 +67,20 @@
|
||||
@@ -60,6 +68,20 @@
|
||||
}).orElse(itemstack);
|
||||
|
||||
if (itemstack1.isItemEnabled(world.enabledFeatures())) {
|
||||
@@ -36,7 +36,7 @@
|
||||
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);
|
||||
@@ -171,7 +193,11 @@
|
||||
@@ -172,7 +194,11 @@
|
||||
ItemStack itemstack1 = (ItemStack) this.items.get(j);
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
+import org.bukkit.inventory.CookingRecipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput {
|
||||
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeCraftingHolder, AutoRecipeOutput {
|
||||
|
||||
protected static final int SLOT_INPUT = 0;
|
||||
@@ -115,7 +129,7 @@
|
||||
@@ -72,18 +72,18 @@
|
||||
return item.builtInRegistryHolder().is(TagsItem.NON_FLAMMABLE_WOOD);
|
||||
}
|
||||
@@ -271,7 +319,7 @@
|
||||
IRecipe irecipe;
|
||||
RecipeHolder recipeholder;
|
||||
|
||||
if (flag2) {
|
||||
- irecipe = (IRecipe) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse((Object) null);
|
||||
+ irecipe = (IRecipe) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error
|
||||
- recipeholder = (RecipeHolder) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse((Object) null);
|
||||
+ recipeholder = (RecipeHolder) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error
|
||||
} else {
|
||||
irecipe = null;
|
||||
recipeholder = null;
|
||||
}
|
||||
@@ -279,9 +327,20 @@
|
||||
int i = tileentityfurnace.getMaxStackSize();
|
||||
|
||||
if (!tileentityfurnace.isLit() && canBurn(world.registryAccess(), irecipe, tileentityfurnace.items, i)) {
|
||||
if (!tileentityfurnace.isLit() && canBurn(world.registryAccess(), recipeholder, tileentityfurnace.items, i)) {
|
||||
- tileentityfurnace.litTime = tileentityfurnace.getBurnDuration(itemstack);
|
||||
+ // CraftBukkit start
|
||||
+ CraftItemStack fuel = CraftItemStack.asCraftMirror(itemstack);
|
||||
@@ -106,11 +106,11 @@
|
||||
@@ -297,11 +356,23 @@
|
||||
}
|
||||
|
||||
if (tileentityfurnace.isLit() && canBurn(world.registryAccess(), irecipe, tileentityfurnace.items, i)) {
|
||||
if (tileentityfurnace.isLit() && canBurn(world.registryAccess(), recipeholder, tileentityfurnace.items, i)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (irecipe != null && tileentityfurnace.cookingProgress == 0) {
|
||||
+ if (recipeholder != null && tileentityfurnace.cookingProgress == 0) {
|
||||
+ CraftItemStack source = CraftItemStack.asCraftMirror(tileentityfurnace.items.get(0));
|
||||
+ CookingRecipe<?> recipe = (CookingRecipe<?>) irecipe.toBukkitRecipe();
|
||||
+ CookingRecipe<?> recipe = (CookingRecipe<?>) recipeholder.toBukkitRecipe();
|
||||
+
|
||||
+ FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(world, blockposition), source, recipe);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
@@ -123,20 +123,20 @@
|
||||
if (tileentityfurnace.cookingProgress == tileentityfurnace.cookingTotalTime) {
|
||||
tileentityfurnace.cookingProgress = 0;
|
||||
tileentityfurnace.cookingTotalTime = getTotalCookTime(world, tileentityfurnace);
|
||||
- if (burn(world.registryAccess(), irecipe, tileentityfurnace.items, i)) {
|
||||
+ if (burn(tileentityfurnace.level, tileentityfurnace.worldPosition, world.registryAccess(), irecipe, tileentityfurnace.items, i)) { // CraftBukkit
|
||||
tileentityfurnace.setRecipeUsed(irecipe);
|
||||
- if (burn(world.registryAccess(), recipeholder, tileentityfurnace.items, i)) {
|
||||
+ if (burn(tileentityfurnace.level, tileentityfurnace.worldPosition, world.registryAccess(), recipeholder, tileentityfurnace.items, i)) { // CraftBukkit
|
||||
tileentityfurnace.setRecipeUsed(recipeholder);
|
||||
}
|
||||
|
||||
@@ -340,17 +411,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
- private static boolean burn(IRegistryCustom iregistrycustom, @Nullable IRecipe<?> irecipe, NonNullList<ItemStack> nonnulllist, int i) {
|
||||
+ private static boolean burn(World world, BlockPosition blockposition, IRegistryCustom iregistrycustom, @Nullable IRecipe<?> irecipe, NonNullList<ItemStack> nonnulllist, int i) { // CraftBukkit
|
||||
if (irecipe != null && canBurn(iregistrycustom, irecipe, nonnulllist, i)) {
|
||||
- private static boolean burn(IRegistryCustom iregistrycustom, @Nullable RecipeHolder<?> recipeholder, NonNullList<ItemStack> nonnulllist, int i) {
|
||||
+ private static boolean burn(World world, BlockPosition blockposition, IRegistryCustom iregistrycustom, @Nullable RecipeHolder<?> recipeholder, NonNullList<ItemStack> nonnulllist, int i) { // CraftBukkit
|
||||
if (recipeholder != null && canBurn(iregistrycustom, recipeholder, nonnulllist, i)) {
|
||||
ItemStack itemstack = (ItemStack) nonnulllist.get(0);
|
||||
ItemStack itemstack1 = irecipe.getResultItem(iregistrycustom);
|
||||
ItemStack itemstack1 = recipeholder.value().getResultItem(iregistrycustom);
|
||||
ItemStack itemstack2 = (ItemStack) nonnulllist.get(2);
|
||||
|
||||
+ // CraftBukkit start - fire FurnaceSmeltEvent
|
||||
@@ -174,45 +174,44 @@
|
||||
|
||||
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));
|
||||
@@ -374,7 +472,7 @@
|
||||
@@ -374,6 +472,7 @@
|
||||
}
|
||||
|
||||
private static int getTotalCookTime(World world, TileEntityFurnace tileentityfurnace) {
|
||||
- return (Integer) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).map(RecipeCooking::getCookingTime).orElse(200);
|
||||
+ return (world != null) ? (Integer) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302
|
||||
}
|
||||
|
||||
public static boolean isFuel(ItemStack itemstack) {
|
||||
@@ -493,8 +591,8 @@
|
||||
+ if (world == null) return 200; // CraftBukkit - SPIGOT-4302
|
||||
return (Integer) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).map((recipeholder) -> {
|
||||
return ((RecipeCooking) recipeholder.value()).getCookingTime();
|
||||
}).orElse(200);
|
||||
@@ -495,8 +594,8 @@
|
||||
@Override
|
||||
public void awardUsedRecipes(EntityHuman entityhuman, List<ItemStack> list) {}
|
||||
|
||||
- public void awardUsedRecipesAndPopExperience(EntityPlayer entityplayer) {
|
||||
- List<IRecipe<?>> list = this.getRecipesToAwardAndPopExperience(entityplayer.serverLevel(), entityplayer.position());
|
||||
- List<RecipeHolder<?>> list = this.getRecipesToAwardAndPopExperience(entityplayer.serverLevel(), entityplayer.position());
|
||||
+ public void awardUsedRecipesAndPopExperience(EntityPlayer entityplayer, ItemStack itemstack, int amount) { // CraftBukkit
|
||||
+ List<IRecipe<?>> list = this.getRecipesToAwardAndPopExperience(entityplayer.serverLevel(), entityplayer.position(), this.worldPosition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
+ List<RecipeHolder<?>> list = this.getRecipesToAwardAndPopExperience(entityplayer.serverLevel(), entityplayer.position(), this.worldPosition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
|
||||
entityplayer.awardRecipes(list);
|
||||
Iterator iterator = list.iterator();
|
||||
@@ -511,6 +609,12 @@
|
||||
@@ -513,6 +612,12 @@
|
||||
}
|
||||
|
||||
public List<IRecipe<?>> getRecipesToAwardAndPopExperience(WorldServer worldserver, Vec3D vec3d) {
|
||||
public List<RecipeHolder<?>> getRecipesToAwardAndPopExperience(WorldServer worldserver, Vec3D vec3d) {
|
||||
+ // CraftBukkit start
|
||||
+ return this.getRecipesToAwardAndPopExperience(worldserver, vec3d, this.worldPosition, null, null, 0);
|
||||
+ }
|
||||
+
|
||||
+ public List<IRecipe<?>> getRecipesToAwardAndPopExperience(WorldServer worldserver, Vec3D vec3d, BlockPosition blockposition, EntityPlayer entityplayer, ItemStack itemstack, int amount) {
|
||||
+ public List<RecipeHolder<?>> getRecipesToAwardAndPopExperience(WorldServer worldserver, Vec3D vec3d, BlockPosition blockposition, EntityPlayer entityplayer, ItemStack itemstack, int amount) {
|
||||
+ // CraftBukkit end
|
||||
List<IRecipe<?>> list = Lists.newArrayList();
|
||||
List<RecipeHolder<?>> list = Lists.newArrayList();
|
||||
ObjectIterator objectiterator = this.recipesUsed.object2IntEntrySet().iterator();
|
||||
|
||||
@@ -519,14 +623,14 @@
|
||||
@@ -521,14 +626,14 @@
|
||||
|
||||
worldserver.getRecipeManager().byKey((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
|
||||
list.add(irecipe);
|
||||
- createExperience(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) irecipe).getExperience());
|
||||
+ createExperience(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) irecipe).getExperience(), blockposition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
worldserver.getRecipeManager().byKey((MinecraftKey) entry.getKey()).ifPresent((recipeholder) -> {
|
||||
list.add(recipeholder);
|
||||
- createExperience(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) recipeholder.value()).getExperience());
|
||||
+ createExperience(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) recipeholder.value()).getExperience(), blockposition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
});
|
||||
}
|
||||
|
||||
@@ -224,7 +223,7 @@
|
||||
int j = MathHelper.floor((float) i * f);
|
||||
float f1 = MathHelper.frac((float) i * f);
|
||||
|
||||
@@ -534,6 +638,17 @@
|
||||
@@ -536,6 +641,17 @@
|
||||
++j;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
ItemStack itemstack = entityitem.getItem().copy();
|
||||
ItemStack itemstack1 = addItem((IInventory) null, iinventory, itemstack, (EnumDirection) null);
|
||||
|
||||
@@ -366,16 +468,40 @@
|
||||
@@ -367,16 +469,40 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
public TileEntityJukeBox(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.JUKEBOX, blockposition, iblockdata);
|
||||
@@ -150,7 +193,7 @@
|
||||
@@ -152,7 +195,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxStackSize() {
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,7 +246,11 @@
|
||||
@@ -205,7 +248,11 @@
|
||||
@VisibleForTesting
|
||||
public void setRecordWithoutPlaying(ItemStack itemstack) {
|
||||
this.items.set(0, itemstack);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
|
||||
@@ -31,6 +31,11 @@
|
||||
@@ -32,6 +32,11 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory {
|
||||
|
||||
public static final int COLUMNS = 9;
|
||||
@@ -50,6 +55,37 @@
|
||||
@@ -51,6 +56,37 @@
|
||||
@Nullable
|
||||
private final EnumColor color;
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
public TileEntityShulkerBox(@Nullable EnumColor enumcolor, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.SHULKER_BOX, blockposition, iblockdata);
|
||||
this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
@@ -162,6 +198,7 @@
|
||||
@@ -172,6 +208,7 @@
|
||||
}
|
||||
|
||||
++this.openCount;
|
||||
@@ -58,7 +58,7 @@
|
||||
this.level.blockEvent(this.worldPosition, this.getBlockState().getBlock(), 1, this.openCount);
|
||||
if (this.openCount == 1) {
|
||||
this.level.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_OPEN, this.worldPosition);
|
||||
@@ -175,6 +212,7 @@
|
||||
@@ -185,6 +222,7 @@
|
||||
public void stopOpen(EntityHuman entityhuman) {
|
||||
if (!this.remove && !entityhuman.isSpectator()) {
|
||||
--this.openCount;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
||||
@@ -173,6 +173,16 @@
|
||||
|
||||
if (!SystemUtils.isBlank(s)) {
|
||||
resolveGameProfile(nbttagcompound, s);
|
||||
+ // CraftBukkit start
|
||||
+ } else {
|
||||
+ net.minecraft.nbt.NBTTagList textures = nbttagcompound.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts
|
||||
+ for (int i = 0; i < textures.size(); i++) {
|
||||
+ if (textures.get(i) instanceof NBTTagCompound && !((NBTTagCompound) textures.get(i)).contains("Signature", 8) && ((NBTTagCompound) textures.get(i)).getString("Value").trim().isEmpty()) {
|
||||
+ nbttagcompound.remove("SkullOwner");
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,10 +34,10 @@
|
||||
world.blockEvent(blockposition, this, b0, enumdirection.get3DDataValue());
|
||||
}
|
||||
|
||||
@@ -317,6 +337,48 @@
|
||||
@@ -318,6 +338,48 @@
|
||||
IBlockData[] aiblockdata = new IBlockData[list.size() + list2.size()];
|
||||
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.getOpposite();
|
||||
int j = 0;
|
||||
int i = 0;
|
||||
+ // CraftBukkit start
|
||||
+ final org.bukkit.block.Block bblock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+
|
||||
@@ -82,4 +82,4 @@
|
||||
+ // CraftBukkit end
|
||||
|
||||
BlockPosition blockposition3;
|
||||
int k;
|
||||
int j;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/chunk/storage/RegionFileCache.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFileCache.java
|
||||
@@ -29,7 +29,7 @@
|
||||
@@ -30,7 +30,7 @@
|
||||
this.sync = flag;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
long i = ChunkCoordIntPair.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ());
|
||||
RegionFile regionfile = (RegionFile) this.regionCache.getAndMoveToFirst(i);
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
@@ -45,6 +45,7 @@
|
||||
Path path = this.folder;
|
||||
int j = chunkcoordintpair.getRegionX();
|
||||
Path path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca");
|
||||
@@ -17,7 +17,7 @@
|
||||
RegionFile regionfile1 = new RegionFile(path1, this.folder, this.sync);
|
||||
|
||||
this.regionCache.putAndMoveToFirst(i, regionfile1);
|
||||
@@ -53,7 +54,12 @@
|
||||
@@ -54,7 +55,12 @@
|
||||
|
||||
@Nullable
|
||||
public NBTTagCompound read(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||
@@ -31,7 +31,7 @@
|
||||
DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkcoordintpair);
|
||||
|
||||
NBTTagCompound nbttagcompound;
|
||||
@@ -93,7 +99,12 @@
|
||||
@@ -94,7 +100,12 @@
|
||||
}
|
||||
|
||||
public void scanChunk(ChunkCoordIntPair chunkcoordintpair, StreamTagVisitor streamtagvisitor) throws IOException {
|
||||
@@ -45,7 +45,7 @@
|
||||
DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkcoordintpair);
|
||||
|
||||
try {
|
||||
@@ -119,7 +130,7 @@
|
||||
@@ -120,7 +131,7 @@
|
||||
}
|
||||
|
||||
protected void write(ChunkCoordIntPair chunkcoordintpair, @Nullable NBTTagCompound nbttagcompound) throws IOException {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
this.gateways.addAll((Collection) enderdragonbattle_a.gateways.orElseGet(() -> {
|
||||
ObjectArrayList<Integer> objectarraylist = new ObjectArrayList(ContiguousSet.create(Range.closedOpen(0, 20), DiscreteDomain.integers()));
|
||||
|
||||
@@ -505,7 +505,7 @@
|
||||
@@ -510,7 +510,7 @@
|
||||
return this.previouslyKilled;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if (this.dragonKilled && this.respawnStage == null) {
|
||||
BlockPosition blockposition = this.portalLocation;
|
||||
|
||||
@@ -532,19 +532,19 @@
|
||||
@@ -537,19 +537,19 @@
|
||||
List<EntityEnderCrystal> list1 = this.level.getEntitiesOfClass(EntityEnderCrystal.class, new AxisAlignedBB(blockposition1.relative(enumdirection, 2)));
|
||||
|
||||
if (list1.isEmpty()) {
|
||||
@@ -45,12 +45,12 @@
|
||||
+ return false; // CraftBukkit - return value
|
||||
}
|
||||
|
||||
- private void respawnDragon(List<EntityEnderCrystal> list) {
|
||||
+ public boolean respawnDragon(List<EntityEnderCrystal> list) { // PAIL private -> public // CraftBukkit - return boolean
|
||||
- public void respawnDragon(List<EntityEnderCrystal> list) {
|
||||
+ public boolean respawnDragon(List<EntityEnderCrystal> list) { // CraftBukkit - return boolean
|
||||
if (this.dragonKilled && this.respawnStage == null) {
|
||||
for (ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = this.findExitPortal(); shapedetector_shapedetectorcollection != null; shapedetector_shapedetectorcollection = this.findExitPortal()) {
|
||||
for (int i = 0; i < this.exitPortalPattern.getWidth(); ++i) {
|
||||
@@ -564,8 +564,9 @@
|
||||
@@ -569,8 +569,9 @@
|
||||
this.respawnTime = 0;
|
||||
this.spawnExitPortal(false);
|
||||
this.respawnCrystals = list;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java
|
||||
+++ b/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java
|
||||
@@ -29,6 +29,12 @@
|
||||
@@ -28,6 +28,12 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public interface VibrationSystem {
|
||||
|
||||
GameEvent[] RESONANCE_EVENTS = new GameEvent[]{GameEvent.RESONATE_1, GameEvent.RESONATE_2, GameEvent.RESONATE_3, GameEvent.RESONATE_4, GameEvent.RESONATE_5, GameEvent.RESONATE_6, GameEvent.RESONATE_7, GameEvent.RESONATE_8, GameEvent.RESONATE_9, GameEvent.RESONATE_10, GameEvent.RESONATE_11, GameEvent.RESONATE_12, GameEvent.RESONATE_13, GameEvent.RESONATE_14, GameEvent.RESONATE_15};
|
||||
@@ -228,7 +234,8 @@
|
||||
@@ -227,7 +233,8 @@
|
||||
if (vibrationsystem_d.requiresAdjacentChunksToBeTicking() && !areAdjacentChunksTicking(worldserver, blockposition1)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -23,7 +23,7 @@
|
||||
vibrationsystem_a.setCurrentVibration((VibrationInfo) null);
|
||||
return true;
|
||||
}
|
||||
@@ -285,8 +292,14 @@
|
||||
@@ -282,8 +289,14 @@
|
||||
return false;
|
||||
} else {
|
||||
Vec3D vec3d1 = (Vec3D) optional.get();
|
||||
@@ -40,7 +40,7 @@
|
||||
return false;
|
||||
} else if (isOccluded(worldserver, vec3d, vec3d1)) {
|
||||
return false;
|
||||
@@ -339,7 +352,7 @@
|
||||
@@ -336,7 +349,7 @@
|
||||
return instance.group(VibrationInfo.CODEC.optionalFieldOf("event").forGetter((vibrationsystem_a) -> {
|
||||
return Optional.ofNullable(vibrationsystem_a.currentVibration);
|
||||
}), VibrationSelector.CODEC.fieldOf("selector").forGetter(VibrationSystem.a::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.a::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.java
|
||||
@@ -20,6 +20,10 @@
|
||||
@@ -21,6 +21,10 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.storage.WorldPersistentData;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class PersistentStructureLegacy {
|
||||
|
||||
private static final Map<String, String> CURRENT_TO_LEGACY_MAP = (Map) SystemUtils.make(Maps.newHashMap(), (hashmap) -> {
|
||||
@@ -235,16 +239,16 @@
|
||||
@@ -236,16 +240,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/material/FluidTypeFlowing.java
|
||||
+++ b/net/minecraft/world/level/material/FluidTypeFlowing.java
|
||||
@@ -31,6 +31,15 @@
|
||||
@@ -32,6 +32,15 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
public abstract class FluidTypeFlowing extends FluidType {
|
||||
|
||||
public static final BlockStateBoolean FALLING = BlockProperties.FALLING;
|
||||
@@ -131,6 +140,15 @@
|
||||
@@ -132,6 +141,15 @@
|
||||
Fluid fluid1 = this.getNewLiquid(world, blockposition1, iblockdata1);
|
||||
|
||||
if (this.canSpreadTo(world, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, world.getFluidState(blockposition1), fluid1.getType())) {
|
||||
@@ -32,7 +32,7 @@
|
||||
this.spreadTo(world, blockposition1, iblockdata1, EnumDirection.DOWN, fluid1);
|
||||
if (this.sourceNeighborCount(world, blockposition) >= 3) {
|
||||
this.spreadToSides(world, blockposition, fluid, iblockdata);
|
||||
@@ -161,6 +179,15 @@
|
||||
@@ -162,6 +180,15 @@
|
||||
IBlockData iblockdata1 = world.getBlockState(blockposition1);
|
||||
|
||||
if (this.canSpreadTo(world, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, world.getFluidState(blockposition1), fluid1.getType())) {
|
||||
@@ -48,7 +48,7 @@
|
||||
this.spreadTo(world, blockposition1, iblockdata1, enumdirection, fluid1);
|
||||
}
|
||||
}
|
||||
@@ -431,12 +458,23 @@
|
||||
@@ -438,12 +465,23 @@
|
||||
|
||||
if (fluid1.isEmpty()) {
|
||||
fluid = fluid1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
||||
+++ b/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
||||
@@ -31,6 +31,16 @@
|
||||
@@ -32,6 +32,16 @@
|
||||
import net.minecraft.world.level.saveddata.PersistentBase;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
public class WorldMap extends PersistentBase {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -53,6 +63,13 @@
|
||||
@@ -54,6 +64,13 @@
|
||||
private final Map<String, WorldMapFrame> frameMarkers = Maps.newHashMap();
|
||||
private int trackedDecorationCount;
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
+ public String id;
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
private WorldMap(int i, int j, byte b0, boolean flag, boolean flag1, boolean flag2, ResourceKey<World> resourcekey) {
|
||||
this.scale = b0;
|
||||
this.centerX = i;
|
||||
@@ -62,6 +79,10 @@
|
||||
public static PersistentBase.a<WorldMap> factory() {
|
||||
return new PersistentBase.a<>(() -> {
|
||||
throw new IllegalStateException("Should never create an empty map saved data");
|
||||
@@ -69,6 +86,10 @@
|
||||
this.unlimitedTracking = flag1;
|
||||
this.locked = flag2;
|
||||
this.setDirty();
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
public static WorldMap createFresh(double d0, double d1, byte b0, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
||||
@@ -79,12 +100,30 @@
|
||||
@@ -86,12 +107,30 @@
|
||||
}
|
||||
|
||||
public static WorldMap load(NBTTagCompound nbttagcompound) {
|
||||
@@ -76,7 +76,7 @@
|
||||
});
|
||||
int i = nbttagcompound.getInt("xCenter");
|
||||
int j = nbttagcompound.getInt("zCenter");
|
||||
@@ -122,13 +161,32 @@
|
||||
@@ -129,13 +168,32 @@
|
||||
|
||||
@Override
|
||||
public NBTTagCompound save(NBTTagCompound nbttagcompound) {
|
||||
@@ -110,7 +110,7 @@
|
||||
nbttagcompound.putInt("xCenter", this.centerX);
|
||||
nbttagcompound.putInt("zCenter", this.centerZ);
|
||||
nbttagcompound.putByte("scale", this.scale);
|
||||
@@ -503,7 +561,7 @@
|
||||
@@ -510,7 +568,7 @@
|
||||
this.player = entityhuman;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
int i = this.minDirtyX;
|
||||
int j = this.minDirtyY;
|
||||
int k = this.maxDirtyX + 1 - this.minDirtyX;
|
||||
@@ -512,7 +570,7 @@
|
||||
@@ -519,7 +577,7 @@
|
||||
|
||||
for (int i1 = 0; i1 < k; ++i1) {
|
||||
for (int j1 = 0; j1 < l; ++j1) {
|
||||
@@ -128,7 +128,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,19 +580,29 @@
|
||||
@@ -529,19 +587,29 @@
|
||||
@Nullable
|
||||
Packet<?> nextUpdatePacket(int i) {
|
||||
WorldMap.b worldmap_b;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/storage/Convertable.java
|
||||
+++ b/net/minecraft/world/level/storage/Convertable.java
|
||||
@@ -74,6 +74,10 @@
|
||||
@@ -80,6 +80,10 @@
|
||||
import net.minecraft.world.level.validation.PathAllowList;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class Convertable {
|
||||
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -160,7 +164,7 @@
|
||||
@@ -169,7 +173,7 @@
|
||||
}
|
||||
|
||||
private static WorldDataConfiguration readDataConfig(Dynamic<?> dynamic) {
|
||||
@@ -20,7 +20,7 @@
|
||||
Logger logger = Convertable.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -176,7 +180,7 @@
|
||||
@@ -185,7 +189,7 @@
|
||||
throw new LevelStorageException(IChatBaseComponent.translatable("selectWorld.load_folder_access"));
|
||||
} else {
|
||||
try {
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
Convertable.a convertable_a;
|
||||
|
||||
@@ -320,6 +324,7 @@
|
||||
@@ -343,6 +347,7 @@
|
||||
WorldDimensions.b worlddimensions_b = generatorsettings.dimensions().bake(iregistry);
|
||||
Lifecycle lifecycle1 = worlddimensions_b.lifecycle().add(lifecycle);
|
||||
WorldDataServer worlddataserver = WorldDataServer.parse(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, worlddimensions_b.specialWorldProperty(), generatorsettings.options(), lifecycle1);
|
||||
@@ -37,14 +37,14 @@
|
||||
|
||||
return Pair.of(worlddataserver, worlddimensions_b);
|
||||
};
|
||||
@@ -415,27 +420,41 @@
|
||||
@@ -441,27 +446,41 @@
|
||||
return this.backupDir;
|
||||
}
|
||||
|
||||
- public Convertable.ConversionSession validateAndCreateAccess(String s) throws IOException, ContentValidationException {
|
||||
+ public Convertable.ConversionSession validateAndCreateAccess(String s, ResourceKey<WorldDimension> dimensionType) throws IOException, ContentValidationException { // CraftBukkit
|
||||
Path path = this.getLevelPath(s);
|
||||
List<ForbiddenSymlinkInfo> list = this.worldDirValidator.validateSave(path, true);
|
||||
List<ForbiddenSymlinkInfo> list = this.worldDirValidator.validateDirectory(path, true);
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
throw new ContentValidationException(path, list);
|
||||
@@ -83,7 +83,7 @@
|
||||
public static record a(List<Convertable.b> levels) implements Iterable<Convertable.b> {
|
||||
|
||||
public boolean isEmpty() {
|
||||
@@ -487,8 +506,12 @@
|
||||
@@ -513,8 +532,12 @@
|
||||
public final Convertable.b levelDirectory;
|
||||
private final String levelId;
|
||||
private final Map<SavedFile, Path> resources = Maps.newHashMap();
|
||||
@@ -97,7 +97,7 @@
|
||||
this.levelId = s;
|
||||
this.levelDirectory = new Convertable.b(path);
|
||||
this.lock = SessionLock.create(path);
|
||||
@@ -499,7 +522,7 @@
|
||||
@@ -529,7 +552,7 @@
|
||||
}
|
||||
|
||||
public Path getLevelPath(SavedFile savedfile) {
|
||||
@@ -106,7 +106,7 @@
|
||||
Convertable.b convertable_b = this.levelDirectory;
|
||||
|
||||
Objects.requireNonNull(this.levelDirectory);
|
||||
@@ -507,7 +530,7 @@
|
||||
@@ -537,7 +560,7 @@
|
||||
}
|
||||
|
||||
public Path getDimensionPath(ResourceKey<World> resourcekey) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/storage/loot/LootDataManager.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/LootDataManager.java
|
||||
@@ -36,6 +36,7 @@
|
||||
@@ -30,6 +30,7 @@
|
||||
public static final LootDataId<LootTable> EMPTY_LOOT_TABLE_KEY = new LootDataId<>(LootDataType.TABLE, LootTables.EMPTY);
|
||||
private Map<LootDataId<?>, ?> elements = Map.of();
|
||||
private Multimap<LootDataType<?>, MinecraftKey> typeKeys = ImmutableMultimap.of();
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public LootDataManager() {}
|
||||
|
||||
@@ -93,7 +94,7 @@
|
||||
@@ -87,7 +88,7 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public <T> T getElement(LootDataId<T> lootdataid) {
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
@@ -105,16 +106,21 @@
|
||||
@@ -99,16 +100,21 @@
|
||||
});
|
||||
this.elements = map1;
|
||||
this.typeKeys = com_google_common_collect_immutablemultimap_builder.build();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/level/storage/loot/LootTable.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/LootTable.java
|
||||
@@ -34,6 +34,13 @@
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@@ -29,6 +29,13 @@
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParameterSets;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -13,8 +13,8 @@
|
||||
+
|
||||
public class LootTable {
|
||||
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -145,9 +152,22 @@
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -149,9 +156,22 @@
|
||||
}
|
||||
|
||||
public void fill(IInventory iinventory, LootParams lootparams, long i) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/storage/loot/functions/LootEnchantFunction.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/functions/LootEnchantFunction.java
|
||||
@@ -49,8 +49,13 @@
|
||||
@@ -57,8 +57,13 @@
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
int i = EnchantmentManager.getMobLooting((EntityLiving) entity);
|
||||
@@ -15,12 +15,3 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@@ -99,7 +104,7 @@
|
||||
public b() {}
|
||||
|
||||
public void serialize(JsonObject jsonobject, LootEnchantFunction lootenchantfunction, JsonSerializationContext jsonserializationcontext) {
|
||||
- super.serialize(jsonobject, (LootItemFunctionConditional) lootenchantfunction, jsonserializationcontext);
|
||||
+ super.serialize(jsonobject, lootenchantfunction, jsonserializationcontext); // CraftBukkit - decompile error
|
||||
jsonobject.add("count", jsonserializationcontext.serialize(lootenchantfunction.value));
|
||||
if (lootenchantfunction.hasLimit()) {
|
||||
jsonobject.add("limit", jsonserializationcontext.serialize(lootenchantfunction.limit));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/storage/loot/predicates/LootItemConditionRandomChanceWithLooting.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/predicates/LootItemConditionRandomChanceWithLooting.java
|
||||
@@ -41,6 +41,11 @@
|
||||
@@ -34,6 +34,11 @@
|
||||
if (entity instanceof EntityLiving) {
|
||||
i = EnchantmentManager.getMobLooting((EntityLiving) entity);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/storage/loot/predicates/LootItemConditionSurvivesExplosion.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/predicates/LootItemConditionSurvivesExplosion.java
|
||||
@@ -34,7 +34,8 @@
|
||||
@@ -32,7 +32,8 @@
|
||||
RandomSource randomsource = loottableinfo.getRandom();
|
||||
float f = 1.0F / ofloat;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user