@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/RayTrace.java
|
||||
+++ b/net/minecraft/world/level/RayTrace.java
|
||||
@@ -24,7 +24,7 @@
|
||||
@@ -26,7 +26,7 @@
|
||||
this.to = vec3d1;
|
||||
this.block = raytrace_blockcollisionoption;
|
||||
this.fluid = raytrace_fluidcollisionoption;
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
public Vec3D getTo() {
|
||||
@@ -69,7 +69,7 @@
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
private final Predicate<Fluid> canPick;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/SpawnerCreature.java
|
||||
+++ b/net/minecraft/world/level/SpawnerCreature.java
|
||||
@@ -47,6 +47,13 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.level.storage.WorldData;
|
||||
@@ -13,7 +13,7 @@
|
||||
+
|
||||
public final class SpawnerCreature {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -73,7 +80,8 @@
|
||||
if (entity instanceof EntityInsentient) {
|
||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||
@@ -70,7 +70,7 @@
|
||||
if (j >= entityinsentient.getMaxSpawnClusterSize()) {
|
||||
return;
|
||||
}
|
||||
@@ -377,7 +404,7 @@
|
||||
@@ -383,7 +410,7 @@
|
||||
|
||||
if (entityinsentient.checkSpawnRules(worldaccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.checkSpawnObstruction(worldaccess)) {
|
||||
groupdataentity = entityinsentient.finalizeSpawn(worldaccess, worldaccess.getCurrentDifficultyAt(entityinsentient.blockPosition()), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, (NBTTagCompound) null);
|
||||
@@ -79,7 +79,7 @@
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
@@ -498,8 +525,10 @@
|
||||
@@ -504,8 +531,10 @@
|
||||
return this.unmodifiableMobCategoryCounts;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
--- a/net/minecraft/world/level/StructureManager.java
|
||||
+++ b/net/minecraft/world/level/StructureManager.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/World.java
|
||||
+++ b/net/minecraft/world/level/World.java
|
||||
@@ -67,6 +67,31 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -65,6 +65,31 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.scores.Scoreboard;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.HashMap;
|
||||
@@ -31,12 +31,12 @@
|
||||
+
|
||||
public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
||||
protected static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -104,7 +129,43 @@
|
||||
public static final Codec<ResourceKey<World>> RESOURCE_KEY_CODEC = MinecraftKey.CODEC.xmap(ResourceKey.elementKey(IRegistry.DIMENSION_REGISTRY), ResourceKey::location);
|
||||
@@ -102,7 +127,43 @@
|
||||
private final ResourceKey<World> dimension;
|
||||
private long subTickCount;
|
||||
|
||||
- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i) {
|
||||
- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, Holder<DimensionManager> holder, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i) {
|
||||
+ // CraftBukkit start Added the following
|
||||
+ private final CraftWorld world;
|
||||
+ public boolean pvpMode;
|
||||
@@ -62,7 +62,7 @@
|
||||
+
|
||||
+ public abstract ResourceKey<WorldDimension> getTypeKey();
|
||||
+
|
||||
+ protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
|
||||
+ protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, Holder<DimensionManager> holder, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
|
||||
+ this.generator = gen;
|
||||
+ this.world = new CraftWorld((WorldServer) this, gen, biomeProvider, env);
|
||||
+
|
||||
@@ -76,23 +76,23 @@
|
||||
+ // CraftBukkit end
|
||||
this.profiler = supplier;
|
||||
this.levelData = worlddatamutable;
|
||||
this.dimensionType = dimensionmanager;
|
||||
@@ -114,12 +175,12 @@
|
||||
this.dimensionTypeRegistration = holder;
|
||||
@@ -113,12 +174,12 @@
|
||||
this.worldBorder = new WorldBorder() {
|
||||
@Override
|
||||
public double getCenterX() {
|
||||
- return super.getCenterX() / dimensionmanager.coordinateScale();
|
||||
- return super.getCenterX() / World.this.dimensionType.coordinateScale();
|
||||
+ return super.getCenterX(); // CraftBukkit
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getCenterZ() {
|
||||
- return super.getCenterZ() / dimensionmanager.coordinateScale();
|
||||
- return super.getCenterZ() / World.this.dimensionType.coordinateScale();
|
||||
+ return super.getCenterZ(); // CraftBukkit
|
||||
}
|
||||
};
|
||||
} else {
|
||||
@@ -129,6 +190,42 @@
|
||||
@@ -128,6 +189,42 @@
|
||||
this.thread = Thread.currentThread();
|
||||
this.biomeManager = new BiomeManager(this, i);
|
||||
this.isDebug = flag1;
|
||||
@@ -135,7 +135,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -186,6 +283,17 @@
|
||||
@@ -185,6 +282,17 @@
|
||||
|
||||
@Override
|
||||
public boolean setBlock(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
|
||||
@@ -153,7 +153,7 @@
|
||||
if (this.isOutsideBuildHeight(blockposition)) {
|
||||
return false;
|
||||
} else if (!this.isClientSide && this.isDebug()) {
|
||||
@@ -193,9 +301,24 @@
|
||||
@@ -192,9 +300,24 @@
|
||||
} else {
|
||||
Chunk chunk = this.getChunkAt(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
@@ -179,7 +179,7 @@
|
||||
return false;
|
||||
} else {
|
||||
IBlockData iblockdata2 = this.getBlockState(blockposition);
|
||||
@@ -206,6 +329,7 @@
|
||||
@@ -205,6 +328,7 @@
|
||||
this.getProfiler().pop();
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
if (iblockdata2 == iblockdata) {
|
||||
if (iblockdata1 != iblockdata2) {
|
||||
this.setBlocksDirty(blockposition, iblockdata1, iblockdata2);
|
||||
@@ -232,12 +356,69 @@
|
||||
@@ -231,12 +355,69 @@
|
||||
|
||||
this.onBlockStateChange(blockposition, iblockdata1, iblockdata2);
|
||||
}
|
||||
@@ -257,7 +257,7 @@
|
||||
public void onBlockStateChange(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
|
||||
|
||||
@Override
|
||||
@@ -327,6 +508,17 @@
|
||||
@@ -326,6 +507,17 @@
|
||||
IBlockData iblockdata = this.getBlockState(blockposition);
|
||||
|
||||
try {
|
||||
@@ -275,7 +275,7 @@
|
||||
iblockdata.neighborChanged(this, blockposition, block, blockposition1, false);
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception while updating neighbours");
|
||||
@@ -369,6 +561,14 @@
|
||||
@@ -368,6 +560,14 @@
|
||||
|
||||
@Override
|
||||
public IBlockData getBlockState(BlockPosition blockposition) {
|
||||
@@ -290,7 +290,7 @@
|
||||
if (this.isOutsideBuildHeight(blockposition)) {
|
||||
return Blocks.VOID_AIR.defaultBlockState();
|
||||
} else {
|
||||
@@ -494,6 +694,16 @@
|
||||
@@ -493,6 +693,16 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity getBlockEntity(BlockPosition blockposition) {
|
||||
@@ -307,7 +307,7 @@
|
||||
return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, Chunk.EnumTileEntityState.IMMEDIATE));
|
||||
}
|
||||
|
||||
@@ -501,6 +711,12 @@
|
||||
@@ -500,6 +710,12 @@
|
||||
BlockPosition blockposition = tileentity.getBlockPos();
|
||||
|
||||
if (!this.isOutsideBuildHeight(blockposition)) {
|
||||
@@ -320,7 +320,7 @@
|
||||
this.getChunkAt(blockposition).addAndRegisterBlockEntity(tileentity);
|
||||
}
|
||||
}
|
||||
@@ -605,7 +821,7 @@
|
||||
@@ -604,7 +820,7 @@
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
EntityComplexPart entitycomplexpart = aentitycomplexpart[j];
|
||||
@@ -329,7 +329,7 @@
|
||||
|
||||
if (t0 != null && predicate.test(t0)) {
|
||||
list.add(t0);
|
||||
@@ -931,6 +1147,14 @@
|
||||
@@ -932,6 +1148,14 @@
|
||||
public abstract LevelEntityGetter<Entity> getEntities();
|
||||
|
||||
protected void postGameEventInRadius(@Nullable Entity entity, GameEvent gameevent, BlockPosition blockposition, int i) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/AbstractCandleBlock.java
|
||||
+++ b/net/minecraft/world/level/block/AbstractCandleBlock.java
|
||||
@@ -38,6 +38,11 @@
|
||||
@@ -37,6 +37,11 @@
|
||||
@Override
|
||||
public void onProjectileHit(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) {
|
||||
if (!world.isClientSide && iprojectile.isOnFire() && this.canBeLit(iblockdata)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BigDripleafBlock.java
|
||||
+++ b/net/minecraft/world/level/block/BigDripleafBlock.java
|
||||
@@ -42,6 +42,11 @@
|
||||
@@ -41,6 +41,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class BigDripleafBlock extends BlockFacingHorizontal implements IBlockFragilePlantElement, IBlockWaterlogged {
|
||||
|
||||
private static final BlockStateBoolean WATERLOGGED = BlockProperties.WATERLOGGED;
|
||||
@@ -110,7 +115,7 @@
|
||||
@@ -109,7 +114,7 @@
|
||||
|
||||
@Override
|
||||
public void onProjectileHit(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) {
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,7 +174,20 @@
|
||||
@@ -168,7 +173,20 @@
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!world.isClientSide) {
|
||||
if (iblockdata.getValue(BigDripleafBlock.TILT) == Tilt.NONE && canEntityTilt(blockposition, entity) && !world.hasNeighborSignal(blockposition)) {
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -183,9 +201,9 @@
|
||||
@@ -182,9 +200,9 @@
|
||||
Tilt tilt = (Tilt) iblockdata.getValue(BigDripleafBlock.TILT);
|
||||
|
||||
if (tilt == Tilt.UNSTABLE) {
|
||||
@@ -55,7 +55,7 @@
|
||||
} else if (tilt == Tilt.FULL) {
|
||||
resetTilt(iblockdata, worldserver, blockposition);
|
||||
}
|
||||
@@ -211,8 +229,10 @@
|
||||
@@ -210,8 +228,10 @@
|
||||
return entity.isOnGround() && entity.position().y > (double) ((float) blockposition.getY() + 0.6875F);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
if (soundeffect != null) {
|
||||
playTiltSound(world, blockposition, soundeffect);
|
||||
}
|
||||
@@ -226,19 +246,27 @@
|
||||
@@ -225,19 +245,27 @@
|
||||
}
|
||||
|
||||
private static void resetTilt(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/Block.java
|
||||
+++ b/net/minecraft/world/level/block/Block.java
|
||||
@@ -352,7 +352,13 @@
|
||||
@@ -354,7 +354,13 @@
|
||||
EntityItem entityitem = (EntityItem) supplier.get();
|
||||
|
||||
entityitem.setDefaultPickUpDelay();
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,7 +384,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,8 +24,8 @@
|
||||
dropResources(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
|
||||
}
|
||||
|
||||
@@ -512,6 +518,12 @@
|
||||
return (ImmutableMap) this.stateDefinition.getPossibleStates().stream().collect(ImmutableMap.toImmutableMap(Function.identity(), function));
|
||||
@@ -520,6 +526,12 @@
|
||||
return this.builtInRegistryHolder;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBamboo.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBamboo.java
|
||||
@@ -186,7 +186,7 @@
|
||||
@@ -185,7 +185,7 @@
|
||||
BlockPosition blockposition1 = blockposition.above(i);
|
||||
IBlockData iblockdata1 = worldserver.getBlockState(blockposition1);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,14 +207,18 @@
|
||||
@@ -206,14 +206,18 @@
|
||||
BlockPosition blockposition1 = blockposition.below(2);
|
||||
IBlockData iblockdata2 = world.getBlockState(blockposition1);
|
||||
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -225,7 +229,14 @@
|
||||
@@ -224,7 +228,14 @@
|
||||
int j = (Integer) iblockdata.getValue(BlockBamboo.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1;
|
||||
int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBambooSapling.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBambooSapling.java
|
||||
@@ -94,6 +94,6 @@
|
||||
@@ -93,6 +93,6 @@
|
||||
}
|
||||
|
||||
protected void growBamboo(World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBeehive.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBeehive.java
|
||||
@@ -108,7 +108,7 @@
|
||||
@@ -105,7 +105,7 @@
|
||||
EntityBee entitybee = (EntityBee) iterator.next();
|
||||
|
||||
if (entitybee.getTarget() == null) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCactus.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCactus.java
|
||||
@@ -23,6 +23,8 @@
|
||||
@@ -22,6 +22,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockCactus extends Block {
|
||||
|
||||
public static final BlockStateInteger AGE = BlockProperties.AGE_15;
|
||||
@@ -59,7 +61,7 @@
|
||||
@@ -58,7 +60,7 @@
|
||||
int j = (Integer) iblockdata.getValue(BlockCactus.AGE);
|
||||
|
||||
if (j == 15) {
|
||||
@@ -18,7 +18,7 @@
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(BlockCactus.AGE, 0);
|
||||
|
||||
worldserver.setBlock(blockposition, iblockdata1, 4);
|
||||
@@ -116,7 +118,9 @@
|
||||
@@ -115,7 +117,9 @@
|
||||
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCake.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCake.java
|
||||
@@ -85,7 +85,18 @@
|
||||
@@ -84,7 +84,18 @@
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
entityhuman.awardStat(StatisticList.EAT_CAKE_SLICE);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCampfire.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCampfire.java
|
||||
@@ -48,6 +48,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);
|
||||
@@ -92,7 +96,9 @@
|
||||
@@ -91,7 +95,9 @@
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!entity.fireImmune() && (Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
super.entityInside(iblockdata, world, blockposition, entity);
|
||||
@@ -202,6 +208,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,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCocoa.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCocoa.java
|
||||
@@ -21,6 +21,8 @@
|
||||
@@ -20,6 +20,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement {
|
||||
|
||||
public static final int MAX_AGE = 2;
|
||||
@@ -55,7 +57,7 @@
|
||||
@@ -54,7 +56,7 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockCocoa.AGE);
|
||||
|
||||
if (i < 2) {
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +127,7 @@
|
||||
@@ -124,7 +126,7 @@
|
||||
|
||||
@Override
|
||||
public void performBonemeal(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCommand.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCommand.java
|
||||
@@ -27,6 +27,8 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||
+
|
||||
public class BlockCommand extends BlockTileEntity implements GameMasterBlock {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -57,6 +59,15 @@
|
||||
TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity;
|
||||
boolean flag1 = world.hasNeighborSignal(blockposition);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockConcretePowder.java
|
||||
+++ b/net/minecraft/world/level/block/BlockConcretePowder.java
|
||||
@@ -12,6 +12,12 @@
|
||||
@@ -11,6 +11,12 @@
|
||||
import net.minecraft.world.level.block.state.BlockBase;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class BlockConcretePowder extends BlockFalling {
|
||||
|
||||
private final IBlockData concrete;
|
||||
@@ -24,7 +30,7 @@
|
||||
@@ -23,7 +29,7 @@
|
||||
@Override
|
||||
public void onLand(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, EntityFallingBlock entityfallingblock) {
|
||||
if (shouldSolidify(world, blockposition, iblockdata1)) {
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,7 +41,24 @@
|
||||
@@ -34,7 +40,24 @@
|
||||
BlockPosition blockposition = blockactioncontext.getClickedPos();
|
||||
IBlockData iblockdata = world.getBlockState(blockposition);
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
|
||||
private static boolean shouldSolidify(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
@@ -71,7 +94,25 @@
|
||||
@@ -70,7 +93,25 @@
|
||||
|
||||
@Override
|
||||
public IBlockData updateShape(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCoral.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCoral.java
|
||||
@@ -26,6 +26,11 @@
|
||||
@@ -25,6 +25,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
if (!this.scanForWater(worldserver, blockposition)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
|
||||
@@ -41,6 +41,11 @@
|
||||
@@ -40,6 +40,11 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
if (!canBeGrass(iblockdata, worldserver, blockposition)) {
|
||||
@@ -12,7 +12,7 @@
|
||||
worldserver.setBlockAndUpdate(blockposition, Blocks.DIRT.defaultBlockState());
|
||||
} else {
|
||||
if (worldserver.getMaxLocalRawBrightness(blockposition.above()) >= 9) {
|
||||
@@ -50,7 +55,7 @@
|
||||
@@ -49,7 +54,7 @@
|
||||
BlockPosition blockposition1 = blockposition.offset(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
|
||||
|
||||
if (worldserver.getBlockState(blockposition1).is(Blocks.DIRT) && canPropagate(iblockdata1, worldserver, blockposition1)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFenceGate.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFenceGate.java
|
||||
@@ -129,6 +129,17 @@
|
||||
@@ -128,6 +128,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,7 +1,7 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFluids.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFluids.java
|
||||
@@ -141,14 +141,20 @@
|
||||
if (world.getFluidState(blockposition1).is((Tag) TagsFluid.WATER)) {
|
||||
@@ -140,14 +140,20 @@
|
||||
if (world.getFluidState(blockposition1).is(TagsFluid.WATER)) {
|
||||
Block block = world.getFluidState(blockposition).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
|
||||
|
||||
- world.setBlockAndUpdate(blockposition, block.defaultBlockState());
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
+ BlockSapling.treeType = org.bukkit.TreeType.CRIMSON_FUNGUS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
((WorldGenFeatureConfigured) this.feature.get()).place(worldserver, worldserver.getChunkSource().getGenerator(), random, blockposition);
|
||||
((WorldGenFeatureConfigured) ((Holder) this.feature.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), random, blockposition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockLeaves.java
|
||||
+++ b/net/minecraft/world/level/block/BlockLeaves.java
|
||||
@@ -20,6 +20,8 @@
|
||||
@@ -19,6 +19,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockLeaves extends Block {
|
||||
|
||||
public static final int DECAY_DISTANCE = 7;
|
||||
@@ -45,6 +47,14 @@
|
||||
@@ -44,6 +46,14 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
if (!(Boolean) iblockdata.getValue(BlockLeaves.PERSISTENT) && (Integer) iblockdata.getValue(BlockLeaves.DISTANCE) == 7) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockLectern.java
|
||||
+++ b/net/minecraft/world/level/block/BlockLectern.java
|
||||
@@ -198,12 +198,13 @@
|
||||
@@ -197,12 +197,13 @@
|
||||
}
|
||||
|
||||
private void popBook(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockMagma.java
|
||||
+++ b/net/minecraft/world/level/block/BlockMagma.java
|
||||
@@ -30,7 +30,9 @@
|
||||
@@ -29,7 +29,9 @@
|
||||
@Override
|
||||
public void stepOn(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
|
||||
if (!entity.fireImmune() && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
public boolean growMushroom(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, Random random) {
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
+ BlockSapling.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.BROWN_MUSHROOM; // CraftBukkit
|
||||
if (((WorldGenFeatureConfigured) this.featureSupplier.get()).place(worldserver, worldserver.getChunkSource().getGenerator(), random, blockposition)) {
|
||||
if (((WorldGenFeatureConfigured) ((Holder) this.featureSupplier.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), random, blockposition)) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockNylium.java
|
||||
+++ b/net/minecraft/world/level/block/BlockNylium.java
|
||||
@@ -30,6 +30,11 @@
|
||||
@@ -31,6 +31,11 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
if (!canBeNylium(iblockdata, worldserver, blockposition)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockPlant.java
|
||||
+++ b/net/minecraft/world/level/block/BlockPlant.java
|
||||
@@ -23,7 +23,14 @@
|
||||
@@ -22,7 +22,14 @@
|
||||
|
||||
@Override
|
||||
public IBlockData updateShape(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockReed.java
|
||||
+++ b/net/minecraft/world/level/block/BlockReed.java
|
||||
@@ -57,7 +57,7 @@
|
||||
@@ -56,7 +56,7 @@
|
||||
int j = (Integer) iblockdata.getValue(BlockReed.AGE);
|
||||
|
||||
if (j == 15) {
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
- if ((Integer) iblockdata1.getValue(BlockScaffolding.DISTANCE) == 7) {
|
||||
+ if ((Integer) iblockdata1.getValue(BlockScaffolding.DISTANCE) == 7 && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) { // CraftBukkit - BlockFadeEvent
|
||||
if ((Integer) iblockdata.getValue(BlockScaffolding.DISTANCE) == 7) {
|
||||
worldserver.addFreshEntity(new EntityFallingBlock(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (IBlockData) iblockdata1.setValue(BlockScaffolding.WATERLOGGED, false)));
|
||||
EntityFallingBlock.fall(worldserver, blockposition, iblockdata1);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockSoil.java
|
||||
+++ b/net/minecraft/world/level/block/BlockSoil.java
|
||||
@@ -26,6 +26,11 @@
|
||||
@@ -25,6 +25,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class BlockSoil extends Block {
|
||||
|
||||
public static final BlockStateInteger MOISTURE = BlockProperties.MOISTURE;
|
||||
@@ -82,26 +87,49 @@
|
||||
@@ -81,26 +86,49 @@
|
||||
|
||||
if (!isNearWater(worldserver, blockposition) && !worldserver.isRainingAt(blockposition.above())) {
|
||||
if (i > 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockSponge.java
|
||||
+++ b/net/minecraft/world/level/block/BlockSponge.java
|
||||
@@ -14,6 +14,13 @@
|
||||
@@ -13,6 +13,13 @@
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class BlockSponge extends Block {
|
||||
|
||||
public static final int MAX_DEPTH = 6;
|
||||
@@ -49,6 +56,7 @@
|
||||
@@ -48,6 +55,7 @@
|
||||
|
||||
queue.add(new Tuple<>(blockposition, 0));
|
||||
int i = 0;
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
while (!queue.isEmpty()) {
|
||||
Tuple<BlockPosition, Integer> tuple = (Tuple) queue.poll();
|
||||
@@ -60,27 +68,31 @@
|
||||
@@ -59,27 +67,31 @@
|
||||
for (int l = 0; l < k; ++l) {
|
||||
EnumDirection enumdirection = aenumdirection[l];
|
||||
BlockPosition blockposition2 = blockposition1.relative(enumdirection);
|
||||
@@ -34,7 +34,7 @@
|
||||
+ // CraftBukkit end
|
||||
Material material = iblockdata.getMaterial();
|
||||
|
||||
if (fluid.is((Tag) TagsFluid.WATER)) {
|
||||
if (fluid.is(TagsFluid.WATER)) {
|
||||
- if (iblockdata.getBlock() instanceof IFluidSource && !((IFluidSource) iblockdata.getBlock()).pickupBlock(world, blockposition2, iblockdata).isEmpty()) {
|
||||
+ if (iblockdata.getBlock() instanceof IFluidSource && !((IFluidSource) iblockdata.getBlock()).pickupBlock(blockList, blockposition2, iblockdata).isEmpty()) { // CraftBukkit
|
||||
++i;
|
||||
@@ -61,7 +61,7 @@
|
||||
++i;
|
||||
if (j < 6) {
|
||||
queue.add(new Tuple<>(blockposition2, j + 1));
|
||||
@@ -93,6 +105,39 @@
|
||||
@@ -92,6 +104,39 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockStem.java
|
||||
+++ b/net/minecraft/world/level/block/BlockStem.java
|
||||
@@ -21,6 +21,8 @@
|
||||
@@ -20,6 +20,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;
|
||||
@@ -57,14 +59,18 @@
|
||||
@@ -56,14 +58,18 @@
|
||||
|
||||
if (i < 7) {
|
||||
iblockdata = (IBlockData) iblockdata.setValue(BlockStem.AGE, i + 1);
|
||||
@@ -20,7 +20,7 @@
|
||||
BlockPosition blockposition1 = blockposition.relative(enumdirection);
|
||||
IBlockData iblockdata1 = worldserver.getBlockState(blockposition1.below());
|
||||
|
||||
if (worldserver.getBlockState(blockposition1).isAir() && (iblockdata1.is(Blocks.FARMLAND) || iblockdata1.is((Tag) TagsBlock.DIRT))) {
|
||||
if (worldserver.getBlockState(blockposition1).isAir() && (iblockdata1.is(Blocks.FARMLAND) || iblockdata1.is(TagsBlock.DIRT))) {
|
||||
- worldserver.setBlockAndUpdate(blockposition1, this.fruit.defaultBlockState());
|
||||
+ // CraftBukkit start
|
||||
+ if (!CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition1, this.fruit.defaultBlockState())) {
|
||||
@@ -30,7 +30,7 @@
|
||||
worldserver.setBlockAndUpdate(blockposition, (IBlockData) this.fruit.getAttachedStem().defaultBlockState().setValue(BlockFacingHorizontal.FACING, enumdirection));
|
||||
}
|
||||
}
|
||||
@@ -93,7 +99,7 @@
|
||||
@@ -92,7 +98,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/BlockTurtleEgg.java
|
||||
+++ b/net/minecraft/world/level/block/BlockTurtleEgg.java
|
||||
@@ -29,6 +29,12 @@
|
||||
@@ -28,6 +28,12 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class BlockTurtleEgg extends Block {
|
||||
|
||||
public static final int MAX_HATCH_LEVEL = 2;
|
||||
@@ -62,6 +68,19 @@
|
||||
@@ -61,6 +67,19 @@
|
||||
private void destroyEgg(World world, IBlockData iblockdata, BlockPosition blockposition, Entity entity, int i) {
|
||||
if (this.canDestroyEgg(world, entity)) {
|
||||
if (!world.isClientSide && world.random.nextInt(i) == 0 && iblockdata.is(Blocks.TURTLE_EGG)) {
|
||||
@@ -33,7 +33,7 @@
|
||||
this.decreaseEggs(world, blockposition, iblockdata);
|
||||
}
|
||||
|
||||
@@ -87,9 +106,19 @@
|
||||
@@ -86,9 +105,19 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockTurtleEgg.HATCH);
|
||||
|
||||
if (i < 2) {
|
||||
@@ -54,7 +54,7 @@
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
|
||||
@@ -100,7 +129,7 @@
|
||||
@@ -99,7 +128,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,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockWitherSkull.java
|
||||
+++ b/net/minecraft/world/level/block/BlockWitherSkull.java
|
||||
@@ -27,6 +27,11 @@
|
||||
@@ -26,6 +26,11 @@
|
||||
import net.minecraft.world.level.block.state.predicate.MaterialPredicate;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class BlockWitherSkull extends BlockSkull {
|
||||
|
||||
@Nullable
|
||||
@@ -50,6 +55,7 @@
|
||||
@@ -49,6 +54,7 @@
|
||||
}
|
||||
|
||||
public static void checkSpawn(World world, BlockPosition blockposition, TileEntitySkull tileentityskull) {
|
||||
@@ -20,7 +20,7 @@
|
||||
if (!world.isClientSide) {
|
||||
IBlockData iblockdata = tileentityskull.getBlockState();
|
||||
boolean flag = iblockdata.is(Blocks.WITHER_SKELETON_SKULL) || iblockdata.is(Blocks.WITHER_SKELETON_WALL_SKULL);
|
||||
@@ -59,12 +65,14 @@
|
||||
@@ -58,12 +64,14 @@
|
||||
ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = shapedetector.find(world, blockposition);
|
||||
|
||||
if (shapedetector_shapedetectorcollection != null) {
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +82,15 @@
|
||||
@@ -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();
|
||||
@@ -53,7 +53,7 @@
|
||||
Iterator iterator = world.getEntitiesOfClass(EntityPlayer.class, entitywither.getBoundingBox().inflate(50.0D)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -82,7 +99,7 @@
|
||||
@@ -81,7 +98,7 @@
|
||||
CriterionTriggers.SUMMONED_ENTITY.trigger(entityplayer, (Entity) entitywither);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
||||
+++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
||||
@@ -41,6 +41,11 @@
|
||||
@@ -43,6 +43,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class PointedDripstoneBlock extends Block implements Fallable, IBlockWaterlogged {
|
||||
|
||||
public static final BlockStateDirection TIP_DIRECTION = BlockProperties.VERTICAL_DIRECTION;
|
||||
@@ -123,6 +128,11 @@
|
||||
@@ -125,6 +130,11 @@
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||
|
||||
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile instanceof EntityThrownTrident && iprojectile.getDeltaMovement().length() > 0.6D) {
|
||||
@@ -24,7 +24,7 @@
|
||||
world.destroyBlock(blockposition, true);
|
||||
}
|
||||
|
||||
@@ -131,7 +141,9 @@
|
||||
@@ -133,7 +143,9 @@
|
||||
@Override
|
||||
public void fallOn(World world, IBlockData iblockdata, BlockPosition blockposition, Entity entity, float f) {
|
||||
if (iblockdata.getValue(PointedDripstoneBlock.TIP_DIRECTION) == EnumDirection.UP && iblockdata.getValue(PointedDripstoneBlock.THICKNESS) == DripstoneThickness.TIP) {
|
||||
@@ -34,7 +34,7 @@
|
||||
} else {
|
||||
super.fallOn(world, iblockdata, blockposition, entity, f);
|
||||
}
|
||||
@@ -405,15 +417,15 @@
|
||||
@@ -380,15 +392,15 @@
|
||||
if (isUnmergedTipWithDirection(iblockdata, enumdirection.getOpposite())) {
|
||||
createMergedTips(iblockdata, worldserver, blockposition1);
|
||||
} else if (iblockdata.isAir() || iblockdata.is(Blocks.WATER)) {
|
||||
@@ -53,7 +53,7 @@
|
||||
}
|
||||
|
||||
private static void createMergedTips(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
@@ -428,8 +440,8 @@
|
||||
@@ -403,8 +415,8 @@
|
||||
blockposition1 = blockposition.below();
|
||||
}
|
||||
|
||||
@@ -64,27 +64,30 @@
|
||||
}
|
||||
|
||||
public static void spawnDripParticle(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
@@ -462,7 +474,7 @@
|
||||
@@ -437,7 +449,7 @@
|
||||
|
||||
return (BlockPosition) findBlockVertical(generatoraccess, blockposition, enumdirection.getAxisDirection(), predicate, (iblockdata1) -> {
|
||||
return (BlockPosition) findBlockVertical(generatoraccess, blockposition, enumdirection.getAxisDirection(), bipredicate, (iblockdata1) -> {
|
||||
return isTip(iblockdata1, flag);
|
||||
- }, i).orElse((Object) null);
|
||||
+ }, i).orElse(null); // CraftBukkit - decompile error
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,12 +587,12 @@
|
||||
return iblockdata.getBlock() instanceof AbstractCauldronBlock && ((AbstractCauldronBlock) iblockdata.getBlock()).canReceiveStalactiteDrip(fluidtype);
|
||||
@@ -553,7 +565,7 @@
|
||||
return canDripThrough(world, blockposition1, iblockdata);
|
||||
};
|
||||
|
||||
- return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.DOWN.getAxisDirection(), BlockBase.BlockData::isAir, predicate, 11).orElse((Object) null);
|
||||
+ return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.DOWN.getAxisDirection(), BlockBase.BlockData::isAir, predicate, 11).orElse(null); // CraftBukkit - decompile error
|
||||
- return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.DOWN.getAxisDirection(), bipredicate, predicate, 11).orElse((Object) null);
|
||||
+ return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.DOWN.getAxisDirection(), bipredicate, predicate, 11).orElse(null); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static BlockPosition findStalactiteTipAboveCauldron(World world, BlockPosition blockposition) {
|
||||
- return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.UP.getAxisDirection(), BlockBase.BlockData::isAir, PointedDripstoneBlock::canDrip, 11).orElse((Object) null);
|
||||
+ return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.UP.getAxisDirection(), BlockBase.BlockData::isAir, PointedDripstoneBlock::canDrip, 11).orElse(null); // CraftBukkit - decompile error
|
||||
@@ -562,7 +574,7 @@
|
||||
return canDripThrough(world, blockposition1, iblockdata);
|
||||
};
|
||||
|
||||
- return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.UP.getAxisDirection(), bipredicate, PointedDripstoneBlock::canDrip, 11).orElse((Object) null);
|
||||
+ return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.UP.getAxisDirection(), bipredicate, PointedDripstoneBlock::canDrip, 11).orElse(null); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public static FluidType getCauldronFillFluidType(World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntity.java
|
||||
@@ -15,8 +15,18 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
|
||||
@@ -16,7 +16,7 @@
|
||||
+ private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||
+ public CraftPersistentDataContainer persistentDataContainer;
|
||||
+ // CraftBukkit end
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private final TileEntityTypes<?> type;
|
||||
@Nullable
|
||||
@@ -48,7 +58,16 @@
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
@@ -39,6 +39,11 @@
|
||||
@@ -38,6 +38,11 @@
|
||||
import net.minecraft.world.level.levelgen.HeightMap;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class TileEntityBeacon extends TileEntity implements ITileInventory {
|
||||
|
||||
private static final int MAX_LEVELS = 4;
|
||||
@@ -61,6 +66,15 @@
|
||||
@@ -60,6 +65,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);
|
||||
@@ -229,39 +243,78 @@
|
||||
@@ -228,39 +242,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);
|
||||
}
|
||||
@@ -290,8 +343,11 @@
|
||||
@@ -289,8 +342,11 @@
|
||||
@Override
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
super.load(nbttagcompound);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
@@ -43,6 +43,7 @@
|
||||
@@ -42,6 +42,7 @@
|
||||
private final List<TileEntityBeehive.HiveBee> stored = Lists.newArrayList();
|
||||
@Nullable
|
||||
public BlockPosition savedFlowerPos;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public TileEntityBeehive(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BEEHIVE, blockposition, iblockdata);
|
||||
@@ -82,7 +83,7 @@
|
||||
@@ -81,7 +82,7 @@
|
||||
}
|
||||
|
||||
public boolean isFull() {
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
|
||||
public void emptyAllLivingFromHive(@Nullable EntityHuman entityhuman, IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
|
||||
@@ -99,7 +100,7 @@
|
||||
@@ -98,7 +99,7 @@
|
||||
|
||||
if (entityhuman.position().distanceToSqr(entity.position()) <= 16.0D) {
|
||||
if (!this.isSedated()) {
|
||||
@@ -26,7 +26,7 @@
|
||||
} else {
|
||||
entitybee.setStayOutOfHiveCountdown(400);
|
||||
}
|
||||
@@ -111,10 +112,16 @@
|
||||
@@ -110,10 +111,16 @@
|
||||
}
|
||||
|
||||
private List<Entity> releaseAllOccupants(IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
|
||||
@@ -44,7 +44,7 @@
|
||||
});
|
||||
if (!list.isEmpty()) {
|
||||
super.setChanged();
|
||||
@@ -142,7 +149,19 @@
|
||||
@@ -141,7 +148,19 @@
|
||||
}
|
||||
|
||||
public void addOccupantWithPresetTicks(Entity entity, boolean flag, int i) {
|
||||
@@ -65,7 +65,7 @@
|
||||
entity.stopRiding();
|
||||
entity.ejectPassengers();
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
@@ -173,7 +192,13 @@
|
||||
@@ -172,7 +191,13 @@
|
||||
}
|
||||
|
||||
private static boolean releaseOccupant(World world, BlockPosition blockposition, IBlockData iblockdata, TileEntityBeehive.HiveBee tileentitybeehive_hivebee, @Nullable List<Entity> list, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus, @Nullable BlockPosition blockposition1) {
|
||||
@@ -80,7 +80,7 @@
|
||||
return false;
|
||||
} else {
|
||||
NBTTagCompound nbttagcompound = tileentitybeehive_hivebee.entityData.copy();
|
||||
@@ -196,6 +221,18 @@
|
||||
@@ -195,6 +220,18 @@
|
||||
if (!entity.getType().is(TagsEntity.BEEHIVE_INHABITORS)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -99,7 +99,7 @@
|
||||
if (entity instanceof EntityBee) {
|
||||
EntityBee entitybee = (EntityBee) entity;
|
||||
|
||||
@@ -225,6 +262,7 @@
|
||||
@@ -226,6 +263,7 @@
|
||||
list.add(entitybee);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
float f = entity.getBbWidth();
|
||||
double d0 = flag ? 0.0D : 0.55D + (double) (f / 2.0F);
|
||||
double d1 = (double) blockposition.getX() + 0.5D + d0 * (double) enumdirection.getStepX();
|
||||
@@ -232,10 +270,11 @@
|
||||
@@ -233,10 +271,11 @@
|
||||
double d3 = (double) blockposition.getZ() + 0.5D + d0 * (double) enumdirection.getStepZ();
|
||||
|
||||
entity.moveTo(d1, d2, d3, entity.getYRot(), entity.getXRot());
|
||||
@@ -120,7 +120,7 @@
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
@@ -284,6 +323,10 @@
|
||||
@@ -285,6 +324,10 @@
|
||||
if (releaseOccupant(world, blockposition, iblockdata, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus, blockposition1)) {
|
||||
flag = true;
|
||||
iterator.remove();
|
||||
@@ -131,7 +131,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -325,6 +368,11 @@
|
||||
@@ -326,6 +369,11 @@
|
||||
this.savedFlowerPos = GameProfileSerializer.readBlockPos(nbttagcompound.getCompound("FlowerPos"));
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -334,6 +382,7 @@
|
||||
@@ -335,6 +383,7 @@
|
||||
if (this.hasSavedFlowerPos()) {
|
||||
nbttagcompound.put("FlowerPos", GameProfileSerializer.writeBlockPos(this.savedFlowerPos));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityConduit.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityConduit.java
|
||||
@@ -29,6 +29,11 @@
|
||||
@@ -28,6 +28,11 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
public class TileEntityConduit extends TileEntity {
|
||||
|
||||
private static final int BLOCK_REFRESH_RATE = 2;
|
||||
@@ -203,7 +208,7 @@
|
||||
@@ -202,7 +207,7 @@
|
||||
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
||||
|
||||
if (blockposition.closerThan((BaseBlockPosition) entityhuman.blockPosition(), (double) j) && entityhuman.isInWaterOrRain()) {
|
||||
if (blockposition.closerThan(entityhuman.blockPosition(), (double) j) && entityhuman.isInWaterOrRain()) {
|
||||
- entityhuman.addEffect(new MobEffect(MobEffects.CONDUIT_POWER, 260, 0, true, true));
|
||||
+ entityhuman.addEffect(new MobEffect(MobEffects.CONDUIT_POWER, 260, 0, true, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONDUIT); // CraftBukkit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,8 +237,13 @@
|
||||
@@ -231,8 +236,13 @@
|
||||
}
|
||||
|
||||
if (tileentityconduit.destroyTarget != null) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
||||
@@ -31,6 +31,14 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -32,6 +32,14 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.level.dimension.WorldDimension;
|
||||
@@ -14,8 +14,8 @@
|
||||
+
|
||||
public class TileEntityEndGateway extends TileEntityEnderPortal {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -167,7 +175,7 @@
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -168,7 +176,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);
|
||||
@@ -196,6 +204,27 @@
|
||||
@@ -197,6 +205,27 @@
|
||||
entity1 = entity.getRootVehicle();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityFurnace.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityFurnace.java
|
||||
@@ -43,6 +43,20 @@
|
||||
@@ -45,6 +45,20 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput {
|
||||
|
||||
protected static final int SLOT_INPUT = 0;
|
||||
@@ -182,6 +196,40 @@
|
||||
@@ -184,6 +198,40 @@
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
private static boolean isNeverAFurnaceFuel(Item item) {
|
||||
return TagsItem.NON_FLAMMABLE_WOOD.contains(item);
|
||||
return item.builtInRegistryHolder().is(TagsItem.NON_FLAMMABLE_WOOD);
|
||||
}
|
||||
@@ -265,13 +313,24 @@
|
||||
@@ -267,13 +315,24 @@
|
||||
tileentityfurnace.cookingProgress = MathHelper.clamp(tileentityfurnace.cookingProgress - 2, (int) 0, tileentityfurnace.cookingTotalTime);
|
||||
}
|
||||
} else {
|
||||
@@ -90,7 +90,7 @@
|
||||
flag1 = true;
|
||||
if (!itemstack.isEmpty()) {
|
||||
Item item = itemstack.getItem();
|
||||
@@ -287,11 +346,23 @@
|
||||
@@ -289,11 +348,23 @@
|
||||
}
|
||||
|
||||
if (tileentityfurnace.isLit() && canBurn(irecipe, tileentityfurnace.items, i)) {
|
||||
@@ -115,7 +115,7 @@
|
||||
tileentityfurnace.setRecipeUsed(irecipe);
|
||||
}
|
||||
|
||||
@@ -330,17 +401,44 @@
|
||||
@@ -332,17 +403,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,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));
|
||||
@@ -364,7 +462,7 @@
|
||||
@@ -366,7 +464,7 @@
|
||||
}
|
||||
|
||||
private static int getTotalCookTime(World world, Recipes<? extends RecipeCooking> recipes, IInventory iinventory) {
|
||||
@@ -170,7 +170,7 @@
|
||||
}
|
||||
|
||||
public static boolean isFuel(ItemStack itemstack) {
|
||||
@@ -483,14 +581,20 @@
|
||||
@@ -485,14 +583,20 @@
|
||||
@Override
|
||||
public void awardUsedRecipes(EntityHuman entityhuman) {}
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
List<IRecipe<?>> list = Lists.newArrayList();
|
||||
ObjectIterator objectiterator = this.recipesUsed.object2IntEntrySet().iterator();
|
||||
|
||||
@@ -499,14 +603,14 @@
|
||||
@@ -501,14 +605,14 @@
|
||||
|
||||
worldserver.getRecipeManager().byKey((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
|
||||
list.add(irecipe);
|
||||
@@ -210,7 +210,7 @@
|
||||
int j = MathHelper.floor((float) i * f);
|
||||
float f1 = MathHelper.frac((float) i * f);
|
||||
|
||||
@@ -514,6 +618,17 @@
|
||||
@@ -516,6 +620,17 @@
|
||||
++j;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
--- a/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
|
||||
+++ b/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
|
||||
@@ -37,6 +37,7 @@
|
||||
if (worldgenfeatureconfigured == null) {
|
||||
@@ -38,6 +38,7 @@
|
||||
if (holder == null) {
|
||||
return false;
|
||||
} else {
|
||||
+ setTreeType(worldgenfeatureconfigured); // CraftBukkit
|
||||
+ setTreeType(holder); // CraftBukkit
|
||||
WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured = (WorldGenFeatureConfigured) holder.value();
|
||||
IBlockData iblockdata1 = Blocks.AIR.defaultBlockState();
|
||||
|
||||
worldserver.setBlock(blockposition.offset(i, 0, j), iblockdata1, 4);
|
||||
|
||||
@@ -14,20 +14,20 @@
|
||||
|
||||
public WorldGenTreeProvider() {}
|
||||
@@ -26,6 +32,7 @@
|
||||
if (worldgenfeatureconfigured == null) {
|
||||
if (holder == null) {
|
||||
return false;
|
||||
} else {
|
||||
+ setTreeType(worldgenfeatureconfigured); // CraftBukkit
|
||||
+ setTreeType(holder); // CraftBukkit
|
||||
WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured = (WorldGenFeatureConfigured) holder.value();
|
||||
|
||||
worldserver.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 4);
|
||||
if (worldgenfeatureconfigured.place(worldserver, chunkgenerator, random, blockposition)) {
|
||||
return true;
|
||||
@@ -51,4 +58,48 @@
|
||||
@@ -53,4 +60,48 @@
|
||||
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ protected void setTreeType(WorldGenFeatureConfigured<?, ?> worldgentreeabstract) {
|
||||
+ protected void setTreeType(Holder<? extends WorldGenFeatureConfigured<?, ?>> worldgentreeabstract) {
|
||||
+ if (worldgentreeabstract == TreeFeatures.OAK || worldgentreeabstract == TreeFeatures.OAK_BEES_005) {
|
||||
+ BlockSapling.treeType = TreeType.TREE;
|
||||
+ } else if (worldgentreeabstract == TreeFeatures.HUGE_RED_MUSHROOM) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/piston/BlockPiston.java
|
||||
+++ b/net/minecraft/world/level/block/piston/BlockPiston.java
|
||||
@@ -38,6 +38,14 @@
|
||||
@@ -37,6 +37,14 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public class BlockPiston extends BlockDirectional {
|
||||
|
||||
public static final BlockStateBoolean EXTENDED = BlockProperties.EXTENDED;
|
||||
@@ -138,6 +146,18 @@
|
||||
@@ -137,6 +145,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
world.blockEvent(blockposition, this, b0, enumdirection.get3DDataValue());
|
||||
}
|
||||
|
||||
@@ -316,6 +336,48 @@
|
||||
@@ -315,6 +335,48 @@
|
||||
IBlockData[] aiblockdata = new IBlockData[list.size() + list2.size()];
|
||||
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.getOpposite();
|
||||
int j = 0;
|
||||
|
||||
@@ -192,12 +192,3 @@
|
||||
this.ticker = blockentityticker;
|
||||
}
|
||||
|
||||
@@ -775,7 +866,7 @@
|
||||
this.loggedInvalidBlockState = true;
|
||||
Chunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new org.apache.logging.log4j.util.Supplier[]{this::getType, this::getPos, () -> {
|
||||
return iblockdata;
|
||||
- }});
|
||||
+ }}); // CraftBukkit - squelch checkstyle
|
||||
}
|
||||
|
||||
gameprofilerfiller.pop();
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
+++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
@@ -225,7 +225,7 @@
|
||||
}
|
||||
@@ -261,7 +261,7 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Holder<StructureFeature<?, ?>> holder = (Holder) iterator.next();
|
||||
- Stream stream = set1.stream();
|
||||
+ Stream<Holder<BiomeBase>> stream = set1.stream(); // CraftBukkit - decompile error
|
||||
HolderSet holderset1 = ((StructureFeature) holder.value()).biomes();
|
||||
|
||||
Objects.requireNonNull(holderset1);
|
||||
@@ -411,7 +411,7 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
- public void applyBiomeDecoration(GeneratorAccessSeed generatoraccessseed, IChunkAccess ichunkaccess, StructureManager structuremanager) {
|
||||
@@ -9,25 +18,25 @@
|
||||
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
|
||||
|
||||
if (!SharedConstants.debugVoidTerrain(chunkcoordintpair)) {
|
||||
@@ -249,7 +249,7 @@
|
||||
@@ -427,7 +427,7 @@
|
||||
Set<BiomeBase> set = new ObjectArraySet();
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
ChunkSection chunksection = achunksection[k];
|
||||
- DataPaletteBlock datapaletteblock = chunksection.getBiomes();
|
||||
+ DataPaletteBlock<BiomeBase> datapaletteblock = chunksection.getBiomes(); // CraftBukkit - decompile error
|
||||
if (this instanceof ChunkProviderFlat) {
|
||||
- Stream stream = this.biomeSource.possibleBiomes().stream().map(Holder::value);
|
||||
+ Stream<BiomeBase> stream = this.biomeSource.possibleBiomes().stream().map(Holder::value); // CraftBukkit - decompile error
|
||||
|
||||
Objects.requireNonNull(set);
|
||||
datapaletteblock.getAll(set::add);
|
||||
@@ -278,7 +278,7 @@
|
||||
StructureGenerator<?> structuregenerator = (StructureGenerator) iterator.next();
|
||||
Objects.requireNonNull(set);
|
||||
stream.forEach(set::add);
|
||||
@@ -467,7 +467,7 @@
|
||||
StructureFeature<?, ?> structurefeature = (StructureFeature) iterator.next();
|
||||
|
||||
seededrandom.setFeatureSeed(i, i1, l);
|
||||
- Supplier supplier = () -> {
|
||||
+ Supplier<String> supplier = () -> { // CraftBukkit - decompile error
|
||||
Optional optional = iregistry1.getResourceKey(structuregenerator).map(Object::toString);
|
||||
Optional optional = iregistry.getResourceKey(structurefeature).map(Object::toString);
|
||||
|
||||
Objects.requireNonNull(structuregenerator);
|
||||
@@ -363,6 +363,33 @@
|
||||
Objects.requireNonNull(structurefeature);
|
||||
@@ -552,6 +552,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,15 +67,6 @@
|
||||
+ // CraftBukkit end
|
||||
+ }
|
||||
+
|
||||
private static StructureBoundingBox getWritableArea(IChunkAccess ichunkaccess) {
|
||||
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
|
||||
int i = chunkcoordintpair.getMinBlockX();
|
||||
@@ -438,7 +465,7 @@
|
||||
public boolean hasFeatureChunkInRange(ResourceKey<StructureSet> resourcekey, long i, int j, int k, int l) {
|
||||
StructureSet structureset = (StructureSet) this.structureSets.get(resourcekey);
|
||||
|
||||
Entry<StructureFeature<?, ?>, Collection<ResourceKey<BiomeBase>>> entry = (Entry) unmodifiableiterator.next();
|
||||
|
||||
- structurestart3 = ((StructureFeature) entry.getKey()).generate(iregistrycustom, this, this.biomeSource, definedstructuremanager, i, chunkcoordintpair, j, structuresettingsfeature1, ichunkaccess, (biomebase) -> {
|
||||
+ structurestart3 = (entry.getKey()).generate(iregistrycustom, this, this.biomeSource, definedstructuremanager, i, chunkcoordintpair, j, structuresettingsfeature1, ichunkaccess, (biomebase) -> { // CraftBukkit - decompile error
|
||||
Collection collection = (Collection) entry.getValue();
|
||||
|
||||
Objects.requireNonNull(collection);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/world/level/chunk/ChunkSection.java
|
||||
+++ b/net/minecraft/world/level/chunk/ChunkSection.java
|
||||
@@ -176,6 +176,12 @@
|
||||
return (BiomeBase) this.biomes.get(i, j, k);
|
||||
@@ -190,6 +190,12 @@
|
||||
return (Holder) this.biomes.get(i, j, k);
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public void setBiome(int i, int j, int k, BiomeBase biome) {
|
||||
+ public void setBiome(int i, int j, int k, Holder<BiomeBase> biome) {
|
||||
+ this.biomes.set(i, j, k, biome);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public void fillBiomesFromNoise(BiomeResolver biomeresolver, Climate.Sampler climate_sampler, int i, int j) {
|
||||
DataPaletteBlock<BiomeBase> datapaletteblock = this.getBiomes();
|
||||
DataPaletteBlock<Holder<BiomeBase>> datapaletteblock = this.getBiomes();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/chunk/IChunkAccess.java
|
||||
+++ b/net/minecraft/world/level/chunk/IChunkAccess.java
|
||||
@@ -77,6 +77,11 @@
|
||||
@@ -80,6 +80,11 @@
|
||||
protected final LevelHeightAccessor levelHeightAccessor;
|
||||
protected final ChunkSection[] sections;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public IChunkAccess(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, LevelHeightAccessor levelheightaccessor, IRegistry<BiomeBase> iregistry, long i, @Nullable ChunkSection[] achunksection, @Nullable BlendingData blendingdata) {
|
||||
this.chunkPos = chunkcoordintpair;
|
||||
this.upgradeData = chunkconverter;
|
||||
@@ -94,7 +99,11 @@
|
||||
@@ -97,7 +102,11 @@
|
||||
}
|
||||
|
||||
replaceMissingSections(levelheightaccessor, iregistry, this.sections);
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
private static void replaceMissingSections(LevelHeightAccessor levelheightaccessor, IRegistry<BiomeBase> iregistry, ChunkSection[] achunksection) {
|
||||
for (int i = 0; i < achunksection.length; ++i) {
|
||||
@@ -258,10 +267,11 @@
|
||||
@@ -259,10 +268,11 @@
|
||||
|
||||
public void setUnsaved(boolean flag) {
|
||||
this.unsaved = flag;
|
||||
@@ -37,12 +37,12 @@
|
||||
}
|
||||
|
||||
public abstract ChunkStatus getStatus();
|
||||
@@ -394,6 +404,27 @@
|
||||
@@ -395,6 +405,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public void setBiome(int i, int j, int k, BiomeBase biome) {
|
||||
+ public void setBiome(int i, int j, int k, Holder<BiomeBase> biome) {
|
||||
+ try {
|
||||
+ int l = QuartPos.fromBlock(this.getMinBuildHeight());
|
||||
+ int i1 = l + QuartPos.fromBlock(this.getHeight()) - 1;
|
||||
@@ -65,7 +65,7 @@
|
||||
public void fillBiomesFromNoise(BiomeResolver biomeresolver, Climate.Sampler climate_sampler) {
|
||||
ChunkCoordIntPair chunkcoordintpair = this.getPos();
|
||||
int i = QuartPos.fromBlock(chunkcoordintpair.getMinBlockX());
|
||||
@@ -425,8 +456,10 @@
|
||||
@@ -426,8 +457,10 @@
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
private final SerializableTickContainer<Block> blocks;
|
||||
private final SerializableTickContainer<FluidType> fluids;
|
||||
|
||||
@@ -442,5 +475,7 @@
|
||||
@@ -443,5 +476,7 @@
|
||||
public SerializableTickContainer<FluidType> fluids() {
|
||||
return this.fluids;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,42 @@
|
||||
--- a/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
|
||||
@@ -190,7 +190,7 @@
|
||||
@@ -117,7 +117,7 @@
|
||||
});
|
||||
logger = ChunkRegionLoader.LOGGER;
|
||||
Objects.requireNonNull(logger);
|
||||
- datapaletteblock = (DataPaletteBlock) dataresult.getOrThrow(false, logger::error);
|
||||
+ datapaletteblock = (DataPaletteBlock) ((DataResult<DataPaletteBlock<IBlockData>>) dataresult).getOrThrow(false, logger::error); // CraftBukkit - decompile error
|
||||
} else {
|
||||
datapaletteblock = new DataPaletteBlock<>(Block.BLOCK_STATE_REGISTRY, Blocks.AIR.defaultBlockState(), DataPaletteBlock.e.SECTION_STATES);
|
||||
}
|
||||
@@ -130,7 +130,7 @@
|
||||
});
|
||||
logger = ChunkRegionLoader.LOGGER;
|
||||
Objects.requireNonNull(logger);
|
||||
- datapaletteblock1 = (DataPaletteBlock) dataresult.getOrThrow(false, logger::error);
|
||||
+ datapaletteblock1 = (DataPaletteBlock) ((DataResult<DataPaletteBlock<Holder<BiomeBase>>>) dataresult).getOrThrow(false, logger::error); // CraftBukkit - decompile error
|
||||
} else {
|
||||
datapaletteblock1 = new DataPaletteBlock<>(iregistry.asHolderIdMap(), iregistry.getHolderOrThrow(Biomes.PLAINS), DataPaletteBlock.e.SECTION_BIOMES);
|
||||
}
|
||||
@@ -161,7 +161,7 @@
|
||||
dataresult = BlendingData.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("blending_data")));
|
||||
logger1 = ChunkRegionLoader.LOGGER;
|
||||
Objects.requireNonNull(logger1);
|
||||
- blendingdata = (BlendingData) dataresult.resultOrPartial(logger1::error).orElse((Object) null);
|
||||
+ blendingdata = (BlendingData) ((DataResult<BlendingData>) dataresult).resultOrPartial(logger1::error).orElse(null); // CraftBukkit - decompile error
|
||||
} else {
|
||||
blendingdata = null;
|
||||
}
|
||||
@@ -192,7 +192,7 @@
|
||||
dataresult = BelowZeroRetrogen.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("below_zero_retrogen")));
|
||||
logger1 = ChunkRegionLoader.LOGGER;
|
||||
Objects.requireNonNull(logger1);
|
||||
- Optional optional = dataresult.resultOrPartial(logger1::error);
|
||||
+ Optional<BelowZeroRetrogen> optional = dataresult.resultOrPartial(logger1::error); // CraftBukkit - decompile error
|
||||
+ Optional<BelowZeroRetrogen> optional = ((DataResult<BelowZeroRetrogen>) dataresult).resultOrPartial(logger1::error); // CraftBukkit - decompile error
|
||||
|
||||
Objects.requireNonNull(protochunk);
|
||||
optional.ifPresent(protochunk::setBelowZeroRetrogen);
|
||||
@@ -219,6 +219,13 @@
|
||||
@@ -221,6 +221,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +50,7 @@
|
||||
((IChunkAccess) object).setLightCorrect(flag);
|
||||
NBTTagCompound nbttagcompound2 = nbttagcompound.getCompound("Heightmaps");
|
||||
EnumSet<HeightMap.Type> enumset = EnumSet.noneOf(HeightMap.Type.class);
|
||||
@@ -321,7 +328,7 @@
|
||||
@@ -323,7 +330,7 @@
|
||||
nbttagcompound.putLong("InhabitedTime", ichunkaccess.getInhabitedTime());
|
||||
nbttagcompound.putString("Status", ichunkaccess.getStatus().getName());
|
||||
BlendingData blendingdata = ichunkaccess.getBlendingData();
|
||||
@@ -32,7 +59,16 @@
|
||||
Logger logger;
|
||||
|
||||
if (blendingdata != null) {
|
||||
@@ -452,6 +459,11 @@
|
||||
@@ -370,7 +377,7 @@
|
||||
|
||||
if (flag1) {
|
||||
ChunkSection chunksection = achunksection[j];
|
||||
- DataResult dataresult1 = ChunkRegionLoader.BLOCK_STATE_CODEC.encodeStart(DynamicOpsNBT.INSTANCE, chunksection.getStates());
|
||||
+ DataResult<NBTBase> dataresult1 = ChunkRegionLoader.BLOCK_STATE_CODEC.encodeStart(DynamicOpsNBT.INSTANCE, chunksection.getStates()); // CraftBukkit - decompile error
|
||||
Logger logger1 = ChunkRegionLoader.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger1);
|
||||
@@ -454,6 +461,11 @@
|
||||
|
||||
nbttagcompound.put("Heightmaps", nbttagcompound3);
|
||||
nbttagcompound.put("structures", packStructureData(StructurePieceSerializationContext.fromLevel(worldserver), chunkcoordintpair, ichunkaccess.getAllStarts(), ichunkaccess.getAllReferences()));
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
- bytebuffer.flip();
|
||||
+ ((java.nio.Buffer) bytebuffer).flip(); // CraftBukkit - decompile error
|
||||
if (bytebuffer.remaining() < 5) {
|
||||
RegionFile.LOGGER.error("Chunk {} header is truncated: expected {} but read {}", chunkcoordintpair, l, bytebuffer.remaining());
|
||||
RegionFile.LOGGER.error("Chunk {} header is truncated: expected {} but read {}", new Object[]{chunkcoordintpair, l, bytebuffer.remaining()});
|
||||
return null;
|
||||
@@ -224,7 +225,7 @@
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
+++ b/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
@@ -32,6 +32,11 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import net.minecraft.world.level.ChunkCoordIntPair;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.level.chunk.storage.EntityStorage;
|
||||
@@ -11,7 +11,7 @@
|
||||
+
|
||||
public class PersistentEntitySectionManager<T extends EntityAccess> implements AutoCloseable {
|
||||
|
||||
static final Logger LOGGER = LogManager.getLogger();
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -55,6 +60,16 @@
|
||||
this.entityGetter = new LevelEntityGetterAdapter<>(this.visibleEntityStorage, this.sectionStorage);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/gameevent/vibrations/VibrationListener.java
|
||||
+++ b/net/minecraft/world/level/gameevent/vibrations/VibrationListener.java
|
||||
@@ -18,6 +18,13 @@
|
||||
@@ -16,6 +16,13 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class VibrationListener implements GameEventListener {
|
||||
|
||||
protected final PositionSource listenerSource;
|
||||
@@ -67,7 +74,13 @@
|
||||
@@ -65,7 +72,13 @@
|
||||
} else {
|
||||
BlockPosition blockposition1 = (BlockPosition) optional.get();
|
||||
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
+// keep
|
||||
package net.minecraft.world.level.levelgen;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/GeneratorSettings.java
|
||||
+++ b/net/minecraft/world/level/levelgen/GeneratorSettings.java
|
||||
@@ -35,9 +35,14 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.resources.RegistryReadOps;
|
||||
+import net.minecraft.server.packs.resources.IResourceManager;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class GeneratorSettings {
|
||||
|
||||
- public static final Codec<GeneratorSettings> CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
+ public static final Codec<GeneratorSettings> CODEC = RecordCodecBuilder.<GeneratorSettings>create((instance) -> { // CraftBukkit - decompile error
|
||||
return instance.group(Codec.LONG.fieldOf("seed").stable().forGetter(GeneratorSettings::seed), Codec.BOOL.fieldOf("generate_features").orElse(true).stable().forGetter(GeneratorSettings::generateFeatures), Codec.BOOL.fieldOf("bonus_chest").orElse(false).stable().forGetter(GeneratorSettings::generateBonusChest), RegistryMaterials.dataPackCodec(IRegistry.LEVEL_STEM_REGISTRY, Lifecycle.stable(), WorldDimension.CODEC).xmap(WorldDimension::sortMap, Function.identity()).fieldOf("dimensions").forGetter(GeneratorSettings::dimensions), Codec.STRING.optionalFieldOf("legacy_custom_options").stable().forGetter((generatorsettings) -> {
|
||||
return generatorsettings.legacyCustomOptions;
|
||||
})).apply(instance, instance.stable(GeneratorSettings::new));
|
||||
@@ -130,7 +135,7 @@
|
||||
public static RegistryMaterials<WorldDimension> withOverworld(RegistryMaterials<WorldDimension> registrymaterials, Supplier<DimensionManager> supplier, ChunkGenerator chunkgenerator) {
|
||||
RegistryMaterials<WorldDimension> registrymaterials1 = new RegistryMaterials<>(IRegistry.LEVEL_STEM_REGISTRY, Lifecycle.experimental());
|
||||
|
||||
- registrymaterials1.register(WorldDimension.OVERWORLD, (Object) (new WorldDimension(supplier, chunkgenerator)), Lifecycle.stable());
|
||||
+ registrymaterials1.register(WorldDimension.OVERWORLD, (new WorldDimension(supplier, chunkgenerator)), Lifecycle.stable()); // CraftBukkit - decompile error
|
||||
Iterator iterator = registrymaterials.entrySet().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -138,7 +143,7 @@
|
||||
ResourceKey<WorldDimension> resourcekey = (ResourceKey) entry.getKey();
|
||||
|
||||
if (resourcekey != WorldDimension.OVERWORLD) {
|
||||
- registrymaterials1.register(resourcekey, (Object) ((WorldDimension) entry.getValue()), registrymaterials.lifecycle((WorldDimension) entry.getValue()));
|
||||
+ registrymaterials1.register(resourcekey, ((WorldDimension) entry.getValue()), registrymaterials.lifecycle((WorldDimension) entry.getValue())); // CraftBukkit - decompile error
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +261,7 @@
|
||||
switch (b0) {
|
||||
case 0:
|
||||
JsonObject jsonobject = !s.isEmpty() ? ChatDeserializer.parse(s) : new JsonObject();
|
||||
- Dynamic<JsonElement> dynamic = new Dynamic(JsonOps.INSTANCE, jsonobject);
|
||||
+ Dynamic<JsonElement> dynamic = new Dynamic(RegistryReadOps.createAndLoad(JsonOps.INSTANCE, IResourceManager.Empty.INSTANCE, (IRegistryCustom.Dimension) iregistrycustom), jsonobject); // CraftBukkit - SPIGOT-6237
|
||||
DataResult dataresult = GeneratorSettingsFlat.CODEC.parse(dynamic);
|
||||
Logger logger = GeneratorSettings.LOGGER;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
|
||||
+++ b/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
|
||||
@@ -116,7 +116,7 @@
|
||||
@@ -117,7 +117,7 @@
|
||||
|
||||
entitymonsterpatrolling.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
entitymonsterpatrolling.finalizeSpawn(worldserver, worldserver.getCurrentDifficultyAt(blockposition), EnumMobSpawn.PATROL, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/StructureSettings.java
|
||||
+++ b/net/minecraft/world/level/levelgen/StructureSettings.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level.levelgen;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
@@ -31,7 +32,8 @@
|
||||
return structuresettings.structureConfig;
|
||||
})).apply(instance, StructureSettings::new);
|
||||
});
|
||||
- public static final ImmutableMap<StructureGenerator<?>, StructureSettingsFeature> DEFAULTS = ImmutableMap.builder().put(StructureGenerator.VILLAGE, new StructureSettingsFeature(34, 8, 10387312)).put(StructureGenerator.DESERT_PYRAMID, new StructureSettingsFeature(32, 8, 14357617)).put(StructureGenerator.IGLOO, new StructureSettingsFeature(32, 8, 14357618)).put(StructureGenerator.JUNGLE_TEMPLE, new StructureSettingsFeature(32, 8, 14357619)).put(StructureGenerator.SWAMP_HUT, new StructureSettingsFeature(32, 8, 14357620)).put(StructureGenerator.PILLAGER_OUTPOST, new StructureSettingsFeature(32, 8, 165745296)).put(StructureGenerator.STRONGHOLD, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.OCEAN_MONUMENT, new StructureSettingsFeature(32, 5, 10387313)).put(StructureGenerator.END_CITY, new StructureSettingsFeature(20, 11, 10387313)).put(StructureGenerator.WOODLAND_MANSION, new StructureSettingsFeature(80, 20, 10387319)).put(StructureGenerator.BURIED_TREASURE, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MINESHAFT, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.RUINED_PORTAL, new StructureSettingsFeature(40, 15, 34222645)).put(StructureGenerator.SHIPWRECK, new StructureSettingsFeature(24, 4, 165745295)).put(StructureGenerator.OCEAN_RUIN, new StructureSettingsFeature(20, 8, 14357621)).put(StructureGenerator.BASTION_REMNANT, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_BRIDGE, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_FOSSIL, new StructureSettingsFeature(2, 1, 14357921)).build();
|
||||
+ // CraftBukkit - decompile error
|
||||
+ public static final ImmutableMap<StructureGenerator<?>, StructureSettingsFeature> DEFAULTS = ImmutableMap.<StructureGenerator<?>, StructureSettingsFeature>builder().put(StructureGenerator.VILLAGE, new StructureSettingsFeature(34, 8, 10387312)).put(StructureGenerator.DESERT_PYRAMID, new StructureSettingsFeature(32, 8, 14357617)).put(StructureGenerator.IGLOO, new StructureSettingsFeature(32, 8, 14357618)).put(StructureGenerator.JUNGLE_TEMPLE, new StructureSettingsFeature(32, 8, 14357619)).put(StructureGenerator.SWAMP_HUT, new StructureSettingsFeature(32, 8, 14357620)).put(StructureGenerator.PILLAGER_OUTPOST, new StructureSettingsFeature(32, 8, 165745296)).put(StructureGenerator.STRONGHOLD, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.OCEAN_MONUMENT, new StructureSettingsFeature(32, 5, 10387313)).put(StructureGenerator.END_CITY, new StructureSettingsFeature(20, 11, 10387313)).put(StructureGenerator.WOODLAND_MANSION, new StructureSettingsFeature(80, 20, 10387319)).put(StructureGenerator.BURIED_TREASURE, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MINESHAFT, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.RUINED_PORTAL, new StructureSettingsFeature(40, 15, 34222645)).put(StructureGenerator.SHIPWRECK, new StructureSettingsFeature(24, 4, 165745295)).put(StructureGenerator.OCEAN_RUIN, new StructureSettingsFeature(20, 8, 14357621)).put(StructureGenerator.BASTION_REMNANT, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_BRIDGE, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_FOSSIL, new StructureSettingsFeature(2, 1, 14357921)).build();
|
||||
public static final StructureSettingsStronghold DEFAULT_STRONGHOLD;
|
||||
private final Map<StructureGenerator<?>, StructureSettingsFeature> structureConfig;
|
||||
private final ImmutableMap<StructureGenerator<?>, ImmutableMultimap<StructureFeature<?, ?>, ResourceKey<BiomeBase>>> configuredStructures;
|
||||
@@ -54,7 +56,7 @@
|
||||
}
|
||||
|
||||
public StructureSettings(Optional<StructureSettingsStronghold> optional, Map<StructureGenerator<?>, StructureSettingsFeature> map) {
|
||||
- this(map, (StructureSettingsStronghold) optional.orElse((Object) null));
|
||||
+ this(map, (StructureSettingsStronghold) optional.orElse(null)); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public StructureSettings(boolean flag) {
|
||||
@@ -81,6 +83,15 @@
|
||||
}
|
||||
|
||||
static {
|
||||
+ // CraftBukkit - decompile error start
|
||||
+ DEFAULT_STRONGHOLD = new StructureSettingsStronghold(32, 3, 128);
|
||||
+
|
||||
+ for (StructureGenerator<?> structuregenerator : IRegistry.STRUCTURE_FEATURE) {
|
||||
+ if (!StructureSettings.DEFAULTS.containsKey(structuregenerator)) {
|
||||
+ throw new IllegalStateException("Structure feature without default settings: " + IRegistry.STRUCTURE_FEATURE.getKey(structuregenerator));
|
||||
+ }
|
||||
+ }
|
||||
+ /*
|
||||
Iterator iterator = IRegistry.STRUCTURE_FEATURE.iterator();
|
||||
|
||||
StructureGenerator structuregenerator;
|
||||
@@ -95,5 +106,7 @@
|
||||
} while (StructureSettings.DEFAULTS.containsKey(structuregenerator));
|
||||
|
||||
throw new IllegalStateException("Structure feature without default settings: " + IRegistry.STRUCTURE_FEATURE.getKey(structuregenerator));
|
||||
+ */
|
||||
+ // CraftBukkit - decompile error end
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.java
|
||||
@@ -20,6 +20,10 @@
|
||||
import net.minecraft.world.level.levelgen.feature.StructureGenerator;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.storage.WorldPersistentData;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -11,7 +11,7 @@
|
||||
public class PersistentStructureLegacy {
|
||||
|
||||
private static final Map<String, String> CURRENT_TO_LEGACY_MAP = (Map) SystemUtils.make(Maps.newHashMap(), (hashmap) -> {
|
||||
@@ -234,16 +238,16 @@
|
||||
@@ -235,16 +239,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 @@
|
||||
@@ -30,6 +30,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 @@
|
||||
@@ -130,6 +139,15 @@
|
||||
Fluid fluid1 = this.getNewLiquid(generatoraccess, blockposition1, iblockdata1);
|
||||
|
||||
if (this.canSpreadTo(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.getFluidState(blockposition1), fluid1.getType())) {
|
||||
@@ -32,7 +32,7 @@
|
||||
this.spreadTo(generatoraccess, blockposition1, iblockdata1, EnumDirection.DOWN, fluid1);
|
||||
if (this.sourceNeighborCount(generatoraccess, blockposition) >= 3) {
|
||||
this.spreadToSides(generatoraccess, blockposition, fluid, iblockdata);
|
||||
@@ -161,6 +179,15 @@
|
||||
@@ -160,6 +178,15 @@
|
||||
IBlockData iblockdata1 = generatoraccess.getBlockState(blockposition1);
|
||||
|
||||
if (this.canSpreadTo(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluidState(blockposition1), fluid1.getType())) {
|
||||
@@ -48,7 +48,7 @@
|
||||
this.spreadTo(generatoraccess, blockposition1, iblockdata1, enumdirection, fluid1);
|
||||
}
|
||||
}
|
||||
@@ -439,12 +466,23 @@
|
||||
@@ -438,12 +465,23 @@
|
||||
|
||||
if (fluid1.isEmpty()) {
|
||||
fluid = fluid1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/material/FluidTypeLava.java
|
||||
+++ b/net/minecraft/world/level/material/FluidTypeLava.java
|
||||
@@ -85,6 +85,13 @@
|
||||
@@ -84,6 +84,13 @@
|
||||
|
||||
if (iblockdata.isAir()) {
|
||||
if (this.hasFlammableNeighbours(world, blockposition1)) {
|
||||
@@ -14,7 +14,7 @@
|
||||
world.setBlockAndUpdate(blockposition1, BlockFireAbstract.getState(world, blockposition1));
|
||||
return;
|
||||
}
|
||||
@@ -101,6 +108,14 @@
|
||||
@@ -100,6 +107,14 @@
|
||||
}
|
||||
|
||||
if (world.isEmptyBlock(blockposition2.above()) && this.isFlammable(world, blockposition2)) {
|
||||
@@ -29,9 +29,9 @@
|
||||
world.setBlockAndUpdate(blockposition2.above(), BlockFireAbstract.getState(world, blockposition2));
|
||||
}
|
||||
}
|
||||
@@ -196,7 +211,11 @@
|
||||
@@ -195,7 +210,11 @@
|
||||
|
||||
if (this.is(TagsFluid.LAVA) && fluid1.is((Tag) TagsFluid.WATER)) {
|
||||
if (this.is(TagsFluid.LAVA) && fluid1.is(TagsFluid.WATER)) {
|
||||
if (iblockdata.getBlock() instanceof BlockFluids) {
|
||||
- generatoraccess.setBlock(blockposition, Blocks.STONE.defaultBlockState(), 3);
|
||||
+ // CraftBukkit start
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/portal/BlockPortalShape.java
|
||||
+++ b/net/minecraft/world/level/portal/BlockPortalShape.java
|
||||
@@ -19,6 +19,11 @@
|
||||
@@ -18,6 +18,11 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockProperties;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class BlockPortalShape {
|
||||
|
||||
private static final int MIN_WIDTH = 2;
|
||||
@@ -36,6 +41,7 @@
|
||||
@@ -35,6 +40,7 @@
|
||||
private BlockPosition bottomLeft;
|
||||
private int height;
|
||||
private final int width;
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
public static Optional<BlockPortalShape> findEmptyPortalShape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
|
||||
return findPortalShape(generatoraccess, blockposition, (blockportalshape) -> {
|
||||
@@ -56,6 +62,7 @@
|
||||
@@ -55,6 +61,7 @@
|
||||
}
|
||||
|
||||
public BlockPortalShape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
|
||||
@@ -28,7 +28,7 @@
|
||||
this.level = generatoraccess;
|
||||
this.axis = enumdirection_enumaxis;
|
||||
this.rightDir = enumdirection_enumaxis == EnumDirection.EnumAxis.X ? EnumDirection.WEST : EnumDirection.SOUTH;
|
||||
@@ -100,6 +107,7 @@
|
||||
@@ -99,6 +106,7 @@
|
||||
|
||||
if (!isEmpty(iblockdata)) {
|
||||
if (BlockPortalShape.FRAME.test(iblockdata, this.level, blockposition_mutableblockposition)) {
|
||||
@@ -36,7 +36,7 @@
|
||||
return i;
|
||||
}
|
||||
break;
|
||||
@@ -110,6 +118,7 @@
|
||||
@@ -109,6 +117,7 @@
|
||||
if (!BlockPortalShape.FRAME.test(iblockdata1, this.level, blockposition_mutableblockposition)) {
|
||||
break;
|
||||
}
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -129,6 +138,7 @@
|
||||
@@ -128,6 +137,7 @@
|
||||
if (!BlockPortalShape.FRAME.test(this.level.getBlockState(blockposition_mutableblockposition1), this.level, blockposition_mutableblockposition1)) {
|
||||
return false;
|
||||
}
|
||||
@@ -52,7 +52,7 @@
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -158,6 +168,10 @@
|
||||
@@ -157,6 +167,10 @@
|
||||
++this.numPortalBlocks;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@
|
||||
}
|
||||
|
||||
return 21;
|
||||
@@ -171,12 +185,28 @@
|
||||
@@ -170,12 +184,28 @@
|
||||
return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
}
|
||||
|
||||
public boolean isComplete() {
|
||||
@@ -213,7 +243,7 @@
|
||||
@@ -212,7 +242,7 @@
|
||||
return new Vec3D(d2, d3, d4);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
BlockPosition blockposition = blockutil_rectangle.minCorner;
|
||||
IBlockData iblockdata = worldserver.getBlockState(blockposition);
|
||||
EnumDirection.EnumAxis enumdirection_enumaxis1 = (EnumDirection.EnumAxis) iblockdata.getOptionalValue(BlockProperties.HORIZONTAL_AXIS).orElse(EnumDirection.EnumAxis.X);
|
||||
@@ -227,6 +257,6 @@
|
||||
@@ -226,6 +256,6 @@
|
||||
boolean flag = enumdirection_enumaxis1 == EnumDirection.EnumAxis.X;
|
||||
Vec3D vec3d3 = new Vec3D((double) blockposition.getX() + (flag ? d2 : d4), (double) blockposition.getY() + d3, (double) blockposition.getZ() + (flag ? d4 : d2));
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
||||
+++ b/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
||||
@@ -31,6 +31,16 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import net.minecraft.world.level.saveddata.PersistentBase;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.UUID;
|
||||
@@ -16,7 +16,7 @@
|
||||
+
|
||||
public class WorldMap extends PersistentBase {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -53,6 +63,13 @@
|
||||
private final Map<String, WorldMapFrame> frameMarkers = Maps.newHashMap();
|
||||
private int trackedDecorationCount;
|
||||
@@ -42,14 +42,19 @@
|
||||
}
|
||||
|
||||
public static WorldMap createFresh(double d0, double d1, byte b0, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
||||
@@ -83,8 +104,26 @@
|
||||
@@ -79,12 +100,30 @@
|
||||
}
|
||||
|
||||
public static WorldMap load(NBTTagCompound nbttagcompound) {
|
||||
- DataResult dataresult = DimensionManager.parseLegacy(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("dimension")));
|
||||
+ DataResult<ResourceKey<World>> dataresult = DimensionManager.parseLegacy(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("dimension"))); // CraftBukkit - decompile error
|
||||
Logger logger = WorldMap.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
- ResourceKey<World> resourcekey = (ResourceKey) dataresult.resultOrPartial(logger::error).orElseThrow(() -> {
|
||||
- return new IllegalArgumentException("Invalid map dimension: " + nbttagcompound.get("dimension"));
|
||||
+ // CraftBukkit start
|
||||
+ ResourceKey<World> resourcekey = (ResourceKey) dataresult.resultOrPartial(logger::error).orElseGet(() -> {
|
||||
+ ResourceKey<World> resourcekey = dataresult.resultOrPartial(logger::error).orElseGet(() -> {
|
||||
+ long least = nbttagcompound.getLong("UUIDLeast");
|
||||
+ long most = nbttagcompound.getLong("UUIDMost");
|
||||
+
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/storage/Convertable.java
|
||||
+++ b/net/minecraft/world/level/storage/Convertable.java
|
||||
@@ -56,6 +56,10 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -58,6 +58,10 @@
|
||||
import net.minecraft.world.level.levelgen.GeneratorSettings;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.level.dimension.WorldDimension;
|
||||
@@ -10,21 +10,30 @@
|
||||
+
|
||||
public class Convertable {
|
||||
|
||||
static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -216,7 +220,11 @@
|
||||
LevelVersion levelversion = LevelVersion.parse(dynamic);
|
||||
WorldSettings worldsettings = WorldSettings.parse(dynamic, datapackconfiguration);
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -112,7 +116,7 @@
|
||||
}
|
||||
|
||||
- return WorldDataServer.parse(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, (GeneratorSettings) pair.getFirst(), (Lifecycle) pair.getSecond());
|
||||
private static DataPackConfiguration readDataPackConfig(Dynamic<?> dynamic) {
|
||||
- DataResult dataresult = DataPackConfiguration.CODEC.parse(dynamic);
|
||||
+ DataResult<DataPackConfiguration> dataresult = DataPackConfiguration.CODEC.parse(dynamic); // CraftBukkit - decompile error
|
||||
Logger logger = Convertable.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -232,7 +236,11 @@
|
||||
WorldSettings worldsettings = WorldSettings.parse(dynamic, datapackconfiguration);
|
||||
Lifecycle lifecycle1 = ((Lifecycle) pair.getSecond()).add(lifecycle);
|
||||
|
||||
- return WorldDataServer.parse(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, (GeneratorSettings) pair.getFirst(), lifecycle1);
|
||||
+ // CraftBukkit start - Add PDC to world
|
||||
+ WorldDataServer worldDataServer = WorldDataServer.parse(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, (GeneratorSettings) pair.getFirst(), (Lifecycle) pair.getSecond());
|
||||
+ WorldDataServer worldDataServer = WorldDataServer.parse(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, (GeneratorSettings) pair.getFirst(), lifecycle1);
|
||||
+ worldDataServer.pdc = nbttagcompound1.get("BukkitValues");
|
||||
+ return worldDataServer;
|
||||
+ // CraftBukkit end
|
||||
} catch (Exception exception) {
|
||||
Convertable.LOGGER.error("Exception reading {}", file, exception);
|
||||
return null;
|
||||
@@ -277,9 +285,23 @@
|
||||
@@ -305,9 +313,23 @@
|
||||
return this.backupDir;
|
||||
}
|
||||
|
||||
@@ -50,7 +59,7 @@
|
||||
|
||||
public class ConversionSession implements AutoCloseable {
|
||||
|
||||
@@ -287,8 +309,12 @@
|
||||
@@ -315,8 +337,12 @@
|
||||
public final Path levelPath;
|
||||
private final String levelId;
|
||||
private final Map<SavedFile, Path> resources = Maps.newHashMap();
|
||||
@@ -64,7 +73,7 @@
|
||||
this.levelId = s;
|
||||
this.levelPath = Convertable.this.baseDir.resolve(s);
|
||||
this.lock = SessionLock.create(this.levelPath);
|
||||
@@ -305,7 +331,7 @@
|
||||
@@ -333,7 +359,7 @@
|
||||
}
|
||||
|
||||
public Path getDimensionPath(ResourceKey<World> resourcekey) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/storage/WorldDataServer.java
|
||||
+++ b/net/minecraft/world/level/storage/WorldDataServer.java
|
||||
@@ -40,6 +40,15 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -41,6 +41,15 @@
|
||||
import net.minecraft.world.level.timers.CustomFunctionCallbackTimers;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutServerDifficulty;
|
||||
@@ -15,8 +15,8 @@
|
||||
+
|
||||
public class WorldDataServer implements IWorldDataServer, SaveData {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -78,6 +87,19 @@
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -80,6 +89,19 @@
|
||||
private final Set<String> knownServerBrands;
|
||||
private boolean wasModded;
|
||||
private final CustomFunctionCallbackTimerQueue<MinecraftServer> scheduledEvents;
|
||||
@@ -36,17 +36,17 @@
|
||||
|
||||
private WorldDataServer(@Nullable DataFixer datafixer, int i, @Nullable NBTTagCompound nbttagcompound, boolean flag, int j, int k, int l, float f, long i1, long j1, int k1, int l1, int i2, boolean flag1, int j2, boolean flag2, boolean flag3, boolean flag4, WorldBorder.c worldborder_c, int k2, int l2, @Nullable UUID uuid, Set<String> set, CustomFunctionCallbackTimerQueue<MinecraftServer> customfunctioncallbacktimerqueue, @Nullable NBTTagCompound nbttagcompound1, NBTTagCompound nbttagcompound2, WorldSettings worldsettings, GeneratorSettings generatorsettings, Lifecycle lifecycle) {
|
||||
this.fixerUpper = datafixer;
|
||||
@@ -121,7 +143,8 @@
|
||||
@@ -123,7 +145,8 @@
|
||||
return (NBTBase) dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap().getValue();
|
||||
});
|
||||
|
||||
- return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), j, dynamic.get("DayTime").asLong(j), levelversion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID) dynamic.get("WanderingTraderId").read(MinecraftSerializableUUID.CODEC).result().orElse((Object) null), (Set) dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> {
|
||||
+ // CraftBukkit - decompile error
|
||||
+ return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), j, dynamic.get("DayTime").asLong(j), levelversion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID) dynamic.get("WanderingTraderId").read(MinecraftSerializableUUID.CODEC).result().orElse(null), (Set) dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> {
|
||||
return SystemUtils.toStream(dynamic1.asString().result());
|
||||
return dynamic1.asString().result().stream();
|
||||
}).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.SERVER_CALLBACKS, dynamic.get("ScheduledEvents").asStream()), (NBTTagCompound) dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), nbttagcompound1, worldsettings, generatorsettings, lifecycle);
|
||||
}
|
||||
@@ -141,7 +164,7 @@
|
||||
@@ -143,7 +166,7 @@
|
||||
|
||||
private void setTagData(IRegistryCustom iregistrycustom, NBTTagCompound nbttagcompound, @Nullable NBTTagCompound nbttagcompound1) {
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
@@ -55,16 +55,16 @@
|
||||
|
||||
Objects.requireNonNull(nbttaglist);
|
||||
stream.forEach(nbttaglist::add);
|
||||
@@ -156,7 +179,7 @@
|
||||
@@ -158,7 +181,7 @@
|
||||
nbttagcompound.put("Version", nbttagcompound2);
|
||||
nbttagcompound.putInt("DataVersion", SharedConstants.getCurrentVersion().getWorldVersion());
|
||||
RegistryWriteOps<NBTBase> registrywriteops = RegistryWriteOps.create(DynamicOpsNBT.INSTANCE, iregistrycustom);
|
||||
- DataResult dataresult = GeneratorSettings.CODEC.encodeStart(registrywriteops, this.worldGenSettings);
|
||||
+ DataResult<NBTBase> dataresult = GeneratorSettings.CODEC.encodeStart(registrywriteops, this.worldGenSettings); // CraftBukkit - decompile error
|
||||
DynamicOps<NBTBase> dynamicops = RegistryOps.create(DynamicOpsNBT.INSTANCE, iregistrycustom);
|
||||
- DataResult dataresult = GeneratorSettings.CODEC.encodeStart(dynamicops, this.worldGenSettings);
|
||||
+ DataResult<NBTBase> dataresult = GeneratorSettings.CODEC.encodeStart(dynamicops, this.worldGenSettings); // CraftBukkit - decompile error
|
||||
Logger logger = WorldDataServer.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -204,6 +227,8 @@
|
||||
@@ -206,6 +229,8 @@
|
||||
nbttagcompound.putUUID("WanderingTraderId", this.wanderingTraderId);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -321,6 +346,20 @@
|
||||
@@ -323,6 +348,20 @@
|
||||
|
||||
@Override
|
||||
public void setThundering(boolean flag) {
|
||||
@@ -94,7 +94,7 @@
|
||||
this.thundering = flag;
|
||||
}
|
||||
|
||||
@@ -341,6 +380,20 @@
|
||||
@@ -343,6 +382,20 @@
|
||||
|
||||
@Override
|
||||
public void setRaining(boolean flag) {
|
||||
@@ -115,7 +115,7 @@
|
||||
this.raining = flag;
|
||||
}
|
||||
|
||||
@@ -407,6 +460,12 @@
|
||||
@@ -409,6 +462,12 @@
|
||||
@Override
|
||||
public void setDifficulty(EnumDifficulty enumdifficulty) {
|
||||
this.settings = this.settings.withDifficulty(enumdifficulty);
|
||||
@@ -128,7 +128,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -527,4 +586,12 @@
|
||||
@@ -529,4 +588,12 @@
|
||||
public WorldSettings getLevelSettings() {
|
||||
return this.settings.copy();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/storage/WorldNBTStorage.java
|
||||
+++ b/net/minecraft/world/level/storage/WorldNBTStorage.java
|
||||
@@ -12,6 +12,13 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.io.FileInputStream;
|
||||
@@ -13,7 +13,7 @@
|
||||
+
|
||||
public class WorldNBTStorage {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -55,6 +62,16 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/storage/loot/LootTable.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/LootTable.java
|
||||
@@ -30,6 +30,13 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.stream.Collectors;
|
||||
@@ -13,7 +13,7 @@
|
||||
+
|
||||
public class LootTable {
|
||||
|
||||
static final Logger LOGGER = LogManager.getLogger();
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -115,8 +122,21 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/level/storage/loot/LootTableRegistry.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/LootTableRegistry.java
|
||||
@@ -22,6 +22,7 @@
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private static final Gson GSON = LootSerialization.createLootTableSerializer().create();
|
||||
private Map<MinecraftKey, LootTable> tables = ImmutableMap.of();
|
||||
+ public Map<LootTable, MinecraftKey> lootTableToKey = ImmutableMap.of(); // CraftBukkit
|
||||
|
||||
Reference in New Issue
Block a user