mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 02:55:47 +01:00
Update to Minecraft 1.14.1
This commit is contained in:
parent
1fee35bef3
commit
89c52b7b0e
@ -1,26 +1,26 @@
|
||||
--- a/net/minecraft/server/BehaviorFarm.java
|
||||
+++ b/net/minecraft/server/BehaviorFarm.java
|
||||
@@ -31,7 +31,7 @@
|
||||
@@ -27,7 +27,7 @@
|
||||
} else if (entityvillager.getVillagerData().getProfession() != VillagerProfession.FARMER) {
|
||||
return false;
|
||||
} else {
|
||||
- Set<BlockPosition> set = (Set) ((List) entityvillager.getBehaviorController().c(MemoryModuleType.SECONDARY_JOB_SITE).get()).stream().map(GlobalPos::b).collect(Collectors.toSet());
|
||||
+ Set<BlockPosition> set = (Set) (entityvillager.getBehaviorController().c(MemoryModuleType.SECONDARY_JOB_SITE).get()).stream().map(GlobalPos::b).collect(Collectors.toSet()); // CraftBukkit - decompile error
|
||||
- Set<BlockPosition> set = (Set) ((List) entityvillager.getBehaviorController().getMemory(MemoryModuleType.SECONDARY_JOB_SITE).get()).stream().map(GlobalPos::b).collect(Collectors.toSet());
|
||||
+ Set<BlockPosition> set = (Set) (entityvillager.getBehaviorController().getMemory(MemoryModuleType.SECONDARY_JOB_SITE).get()).stream().map(GlobalPos::b).collect(Collectors.toSet()); // CraftBukkit - decompile error
|
||||
BlockPosition blockposition = new BlockPosition(entityvillager);
|
||||
Stream stream = ImmutableList.of(blockposition.down(), blockposition.south(), blockposition.north(), blockposition.east(), blockposition.west()).stream();
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
@@ -57,8 +57,8 @@
|
||||
|
||||
protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) {
|
||||
if (i > this.d && this.a != null) {
|
||||
- entityvillager.getBehaviorController().a(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.a)));
|
||||
- entityvillager.getBehaviorController().a(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1)));
|
||||
+ entityvillager.getBehaviorController().a(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.a))); // CraftBukkit - decompile error
|
||||
+ entityvillager.getBehaviorController().a(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); // CraftBukkit - decompile error
|
||||
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.a)));
|
||||
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1)));
|
||||
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.a))); // CraftBukkit - decompile error
|
||||
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,7 +80,11 @@
|
||||
@@ -76,7 +76,11 @@
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
if (block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata) && this.c) {
|
||||
@ -33,7 +33,7 @@
|
||||
} else if (iblockdata.isAir() && this.b) {
|
||||
InventorySubcontainer inventorysubcontainer = entityvillager.getInventory();
|
||||
|
||||
@@ -89,19 +93,28 @@
|
||||
@@ -85,19 +89,28 @@
|
||||
boolean flag = false;
|
||||
|
||||
if (!itemstack.isEmpty()) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/BehaviorInteractDoor.java
|
||||
+++ b/net/minecraft/server/BehaviorInteractDoor.java
|
||||
@@ -27,7 +27,7 @@
|
||||
@@ -23,7 +23,7 @@
|
||||
Set<BlockPosition> set = this.a(worldserver, list, list1);
|
||||
int j = pathentity.f() - 1;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
private Set<BlockPosition> a(WorldServer worldserver, List<GlobalPos> list, List<BlockPosition> list1) {
|
||||
@@ -39,13 +39,20 @@
|
||||
@@ -35,13 +35,20 @@
|
||||
return (Set) stream.filter(list1::contains).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/BehaviorMakeLove.java
|
||||
+++ b/net/minecraft/server/BehaviorMakeLove.java
|
||||
@@ -100,6 +100,11 @@
|
||||
@@ -93,6 +93,11 @@
|
||||
|
||||
private Optional<EntityVillager> a(EntityVillager entityvillager, EntityVillager entityvillager1) {
|
||||
EntityVillager entityvillager2 = entityvillager.createChild(entityvillager1);
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
if (entityvillager2 == null) {
|
||||
return Optional.empty();
|
||||
@@ -108,7 +113,7 @@
|
||||
@@ -101,7 +106,7 @@
|
||||
entityvillager1.setAgeRaw(6000);
|
||||
entityvillager2.setAgeRaw(-24000);
|
||||
entityvillager2.setPositionRotation(entityvillager.locX, entityvillager.locY, entityvillager.locZ, 0.0F, 0.0F);
|
||||
@ -21,11 +21,11 @@
|
||||
entityvillager.world.broadcastEntityEffect(entityvillager2, (byte) 12);
|
||||
return Optional.of(entityvillager2);
|
||||
}
|
||||
@@ -117,6 +122,6 @@
|
||||
@@ -110,6 +115,6 @@
|
||||
private void a(WorldServer worldserver, EntityVillager entityvillager, BlockPosition blockposition) {
|
||||
GlobalPos globalpos = GlobalPos.a(worldserver.getWorldProvider().getDimensionManager(), blockposition);
|
||||
|
||||
- entityvillager.getBehaviorController().a(MemoryModuleType.HOME, (Object) globalpos);
|
||||
+ entityvillager.getBehaviorController().a(MemoryModuleType.HOME, globalpos); // CraftBukkit - decompile error
|
||||
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, (Object) globalpos);
|
||||
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, globalpos); // CraftBukkit - decompile error
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/Block.java
|
||||
+++ b/net/minecraft/server/Block.java
|
||||
@@ -427,7 +427,8 @@
|
||||
@@ -435,7 +435,8 @@
|
||||
}
|
||||
|
||||
public static List<ItemStack> getDrops(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, @Nullable TileEntity tileentity, Entity entity, ItemStack itemstack) {
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
return iblockdata.a(loottableinfo_builder);
|
||||
}
|
||||
@@ -481,7 +482,13 @@
|
||||
@@ -489,7 +490,13 @@
|
||||
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack);
|
||||
|
||||
entityitem.defaultPickupDelay();
|
||||
@ -25,7 +25,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,6 +685,12 @@
|
||||
@@ -686,6 +693,12 @@
|
||||
return block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL;
|
||||
}
|
||||
|
||||
|
@ -24,4 +24,4 @@
|
||||
+ // CraftBukkit end
|
||||
|
||||
tileentitycommand.a(flag1);
|
||||
if (!flag2 && !tileentitycommand.f() && tileentitycommand.t() != TileEntityCommand.Type.SEQUENCE) {
|
||||
if (!flag2 && !tileentitycommand.f() && tileentitycommand.u() != TileEntityCommand.Type.SEQUENCE) {
|
||||
|
@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
@@ -70,8 +74,10 @@
|
||||
WorldGenerator<WorldGenFeatureEmptyConfiguration> worldgenerator = null;
|
||||
WorldGenerator<WorldGenHugeMushroomConfiguration> worldgenerator = null;
|
||||
|
||||
if (this == Blocks.BROWN_MUSHROOM) {
|
||||
+ BlockSapling.treeType = TreeType.BROWN_MUSHROOM; // CraftBukkit
|
||||
|
@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/server/BlockTNT.java
|
||||
+++ b/net/minecraft/server/BlockTNT.java
|
||||
@@ -92,6 +92,11 @@
|
||||
Entity entity1 = entityarrow.getShooter();
|
||||
@@ -93,6 +93,11 @@
|
||||
|
||||
if (entityarrow.isBurning()) {
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
a(world, blockposition, entity1 instanceof EntityLiving ? (EntityLiving) entity1 : null);
|
||||
world.a(blockposition, false);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
public class Chunk implements IChunkAccess {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -91,8 +98,19 @@
|
||||
@@ -95,8 +102,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
public Chunk(World world, ProtoChunk protochunk) {
|
||||
this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.q(), protochunk.getSections(), (Consumer) null);
|
||||
Iterator iterator = protochunk.y().iterator();
|
||||
@@ -134,6 +152,7 @@
|
||||
@@ -138,6 +156,7 @@
|
||||
|
||||
this.b(protochunk.r());
|
||||
this.s = true;
|
||||
@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -224,9 +243,16 @@
|
||||
@@ -228,9 +247,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
int i = blockposition.getX() & 15;
|
||||
int j = blockposition.getY();
|
||||
int k = blockposition.getZ() & 15;
|
||||
@@ -278,7 +304,8 @@
|
||||
@@ -282,7 +308,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
iblockdata.onPlace(this.world, blockposition, iblockdata1, flag);
|
||||
}
|
||||
|
||||
@@ -378,7 +405,12 @@
|
||||
@@ -382,7 +409,12 @@
|
||||
|
||||
@Nullable
|
||||
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
|
||||
@ -83,7 +83,7 @@
|
||||
|
||||
if (tileentity == null) {
|
||||
NBTTagCompound nbttagcompound = (NBTTagCompound) this.e.remove(blockposition);
|
||||
@@ -425,6 +457,13 @@
|
||||
@@ -429,6 +461,13 @@
|
||||
tileentity1.m();
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,6 +492,41 @@
|
||||
@@ -457,6 +496,41 @@
|
||||
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
public void markDirty() {
|
||||
this.s = true;
|
||||
}
|
||||
@@ -527,7 +601,7 @@
|
||||
@@ -531,7 +605,7 @@
|
||||
Iterator iterator = this.entitySlices[k].a(oclass).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@ -148,7 +148,7 @@
|
||||
|
||||
if (t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) {
|
||||
list.add(t0);
|
||||
@@ -601,7 +675,7 @@
|
||||
@@ -605,7 +679,7 @@
|
||||
|
||||
@Override
|
||||
public boolean isNeedsSaving() {
|
||||
@ -157,21 +157,36 @@
|
||||
}
|
||||
|
||||
public void d(boolean flag) {
|
||||
@@ -691,7 +765,7 @@
|
||||
}
|
||||
@@ -746,7 +820,7 @@
|
||||
|
||||
public void B() {
|
||||
if (this.o instanceof ProtoChunkTickList) {
|
||||
- ((ProtoChunkTickList) this.o).a(this.world.getBlockTickList(), (blockposition1) -> {
|
||||
+ ((ProtoChunkTickList<Block>) this.o).a(this.world.getBlockTickList(), (blockposition1) -> { // CraftBukkit - decompile error
|
||||
return this.getType(blockposition1).getBlock();
|
||||
- ((ProtoChunkTickList) this.o).a(this.world.getBlockTickList(), (blockposition) -> {
|
||||
+ ((ProtoChunkTickList<Block>) this.o).a(this.world.getBlockTickList(), (blockposition) -> { // CraftBukkit - decompile error
|
||||
return this.getType(blockposition).getBlock();
|
||||
});
|
||||
} else if (this.o instanceof TickListChunk) {
|
||||
@@ -700,7 +774,7 @@
|
||||
this.o = TickListEmpty.a();
|
||||
@@ -756,7 +830,7 @@
|
||||
}
|
||||
|
||||
if (this.p instanceof ProtoChunkTickList) {
|
||||
- ((ProtoChunkTickList) this.p).a(this.world.getFluidTickList(), (blockposition1) -> {
|
||||
+ ((ProtoChunkTickList<FluidType>) this.p).a(this.world.getFluidTickList(), (blockposition1) -> { // CraftBukkit - decompile error
|
||||
return this.getFluid(blockposition1).getType();
|
||||
- ((ProtoChunkTickList) this.p).a(this.world.getFluidTickList(), (blockposition) -> {
|
||||
+ ((ProtoChunkTickList<FluidType>) this.p).a(this.world.getFluidTickList(), (blockposition) -> { // CraftBukkit - decompile error
|
||||
return this.getFluid(blockposition).getType();
|
||||
});
|
||||
} else if (this.p instanceof TickListChunk) {
|
||||
this.p = TickListEmpty.a();
|
||||
@@ -768,12 +842,12 @@
|
||||
}
|
||||
|
||||
public void a(WorldServer worldserver) {
|
||||
- if (this.o == TickListEmpty.a()) {
|
||||
+ if (this.o == TickListEmpty.<Block>a()) { // CraftBukkit - decompile error
|
||||
this.o = new TickListChunk<>(IRegistry.BLOCK::getKey, worldserver.getBlockTickList().a(true, this.loc));
|
||||
this.setNeedsSaving(true);
|
||||
}
|
||||
|
||||
- if (this.p == TickListEmpty.a()) {
|
||||
+ if (this.p == TickListEmpty.<FluidType>a()) { // CraftBukkit - decompile error
|
||||
this.p = new TickListChunk<>(IRegistry.FLUID::getKey, worldserver.getFluidTickList().a(true, this.loc));
|
||||
this.setNeedsSaving(true);
|
||||
}
|
||||
|
@ -1,15 +1,6 @@
|
||||
--- a/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
if (flag1) {
|
||||
completablefuture = this.getChunkFutureMainThread(i, j, chunkstatus, flag);
|
||||
- this.serverThreadQueue.awaitTasks(completablefuture::isDone);
|
||||
+ this.serverThreadQueue.awaitTasks((BooleanSupplier) completablefuture::isDone); // CraftBukkit - decompile error
|
||||
} else {
|
||||
completablefuture = CompletableFuture.supplyAsync(() -> {
|
||||
return this.getChunkFutureMainThread(i, j, chunkstatus, flag);
|
||||
@@ -193,6 +193,17 @@
|
||||
@@ -241,6 +241,17 @@
|
||||
this.playerChunkMap.close();
|
||||
}
|
||||
|
||||
@ -27,7 +18,7 @@
|
||||
public void tick(BooleanSupplier booleansupplier) {
|
||||
this.world.getMethodProfiler().enter("purge");
|
||||
this.chunkMapDistance.purgeTickets();
|
||||
@@ -211,14 +222,14 @@
|
||||
@@ -260,13 +271,13 @@
|
||||
this.lastTickTime = i;
|
||||
WorldData worlddata = this.world.getWorldData();
|
||||
boolean flag = worlddata.getType() == WorldType.DEBUG_ALL_BLOCK_STATES;
|
||||
@ -36,15 +27,14 @@
|
||||
|
||||
if (!flag) {
|
||||
this.world.getMethodProfiler().enter("pollingChunks");
|
||||
int k = this.chunkMapDistance.b();
|
||||
int l = this.world.getGameRules().c("randomTickSpeed");
|
||||
int k = this.world.getGameRules().c("randomTickSpeed");
|
||||
BlockPosition blockposition = this.world.getSpawn();
|
||||
- boolean flag2 = worlddata.getTime() % 400L == 0L;
|
||||
+ boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit // PAIL: TODO monster ticks
|
||||
EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values();
|
||||
Object2IntMap<EnumCreatureType> object2intmap = this.world.l();
|
||||
ObjectBidirectionalIterator objectbidirectionaliterator = this.playerChunkMap.f();
|
||||
@@ -244,8 +255,30 @@
|
||||
|
||||
this.world.getMethodProfiler().enter("naturalSpawnCount");
|
||||
int l = this.chunkMapDistance.b();
|
||||
@@ -299,8 +310,30 @@
|
||||
for (int j1 = 0; j1 < i1; ++j1) {
|
||||
EnumCreatureType enumcreaturetype = aenumcreaturetype1[j1];
|
||||
|
||||
@ -71,8 +61,8 @@
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (enumcreaturetype != EnumCreatureType.MISC && (!enumcreaturetype.c() || this.allowAnimals) && (enumcreaturetype.c() || this.allowMonsters) && (!enumcreaturetype.d() || flag2)) {
|
||||
- int k1 = enumcreaturetype.b() * k / ChunkProviderServer.b;
|
||||
+ int k1 = limit * k / ChunkProviderServer.b; // CraftBukkit - use per-world limits
|
||||
- int k1 = enumcreaturetype.b() * l / ChunkProviderServer.b;
|
||||
+ int k1 = limit * l / ChunkProviderServer.b; // CraftBukkit - use per-world limits
|
||||
|
||||
if (object2intmap.getInt(enumcreaturetype) <= k1) {
|
||||
SpawnerCreature.a(enumcreaturetype, (World) this.world, chunk, blockposition);
|
||||
|
@ -12,15 +12,6 @@
|
||||
|
||||
public class CommandTeleport {
|
||||
|
||||
@@ -47,7 +52,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity1 = (Entity) iterator.next();
|
||||
|
||||
- a(commandlistenerwrapper, entity1, commandlistenerwrapper.getWorld(), entity.locX, entity.locY, entity.locZ, EnumSet.noneOf(PacketPlayOutPosition.EnumPlayerTeleportFlags.class), entity.yaw, entity.pitch, (CommandTeleport.a) null);
|
||||
+ a(commandlistenerwrapper, entity1, (WorldServer) entity.world, entity.locX, entity.locY, entity.locZ, EnumSet.noneOf(PacketPlayOutPosition.EnumPlayerTeleportFlags.class), entity.yaw, entity.pitch, (CommandTeleport.a) null); // SPIGOT-4245, MC-128441 - use target world as destination
|
||||
}
|
||||
|
||||
if (collection.size() == 1) {
|
||||
@@ -118,9 +123,9 @@
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
+ return bukkitEntity;
|
||||
+ }
|
||||
+
|
||||
+ CraftInventoryCartography inventory = new CraftInventoryCartography(this.inventory, this.f);
|
||||
+ CraftInventoryCartography inventory = new CraftInventoryCartography(this.inventory, this.resultInventory);
|
||||
+ bukkitEntity = new CraftInventoryView(this.player, inventory, this);
|
||||
+ return bukkitEntity;
|
||||
+ }
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/CustomFunctionData.java
|
||||
+++ b/net/minecraft/server/CustomFunctionData.java
|
||||
@@ -53,7 +53,7 @@
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
|
||||
public com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> d() {
|
||||
|
@ -9,7 +9,7 @@
|
||||
return !(entity instanceof EntityHuman);
|
||||
});
|
||||
|
||||
@@ -384,11 +384,13 @@
|
||||
@@ -388,11 +388,13 @@
|
||||
}
|
||||
|
||||
private static Optional<Entity> a(GeneratorAccess generatoraccess, NBTTagCompound nbttagcompound) {
|
||||
@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
public BlockPosition a(EnumBlockRotation enumblockrotation) {
|
||||
@@ -797,7 +799,7 @@
|
||||
@@ -801,7 +803,7 @@
|
||||
public IBlockData a(int i) {
|
||||
IBlockData iblockdata = (IBlockData) this.b.fromId(i);
|
||||
|
||||
|
@ -1,38 +1,32 @@
|
||||
--- a/net/minecraft/server/DimensionManager.java
|
||||
+++ b/net/minecraft/server/DimensionManager.java
|
||||
@@ -8,25 +8,29 @@
|
||||
@@ -8,9 +8,11 @@
|
||||
|
||||
public class DimensionManager implements MinecraftSerializable {
|
||||
|
||||
- public static final DimensionManager OVERWORLD = a("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true));
|
||||
- public static final DimensionManager NETHER = a("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false));
|
||||
- public static final DimensionManager THE_END = a("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false));
|
||||
- public static final DimensionManager OVERWORLD = register("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true));
|
||||
- public static final DimensionManager NETHER = register("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false));
|
||||
- public static final DimensionManager THE_END = register("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false));
|
||||
+ // CraftBukkit start
|
||||
+ public static final DimensionManager OVERWORLD = a("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true, null));
|
||||
+ public static final DimensionManager NETHER = a("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false, null));
|
||||
+ public static final DimensionManager THE_END = a("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false, null));
|
||||
+ public static final DimensionManager OVERWORLD = register("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true, null));
|
||||
+ public static final DimensionManager NETHER = register("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false, null));
|
||||
+ public static final DimensionManager THE_END = register("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false, null));
|
||||
+ // CraftBukkit end
|
||||
private final int d;
|
||||
private final String e;
|
||||
- private final String f;
|
||||
- private final BiFunction<World, DimensionManager, ? extends WorldProvider> g;
|
||||
+ public final String f;
|
||||
+ public final BiFunction<World, DimensionManager, ? extends WorldProvider> g;
|
||||
private final boolean h;
|
||||
|
||||
- private static DimensionManager a(String s, DimensionManager dimensionmanager) {
|
||||
+ public static DimensionManager a(String s, DimensionManager dimensionmanager) {
|
||||
return (DimensionManager) IRegistry.a(IRegistry.DIMENSION_TYPE, dimensionmanager.d, s, dimensionmanager);
|
||||
private final int id;
|
||||
private final String suffix;
|
||||
public final String folder;
|
||||
@@ -21,12 +23,14 @@
|
||||
return (DimensionManager) IRegistry.a(IRegistry.DIMENSION_TYPE, dimensionmanager.id, s, dimensionmanager);
|
||||
}
|
||||
|
||||
- public DimensionManager(int i, String s, String s1, BiFunction<World, DimensionManager, ? extends WorldProvider> bifunction, boolean flag) {
|
||||
+ // CraftBukkit - add type
|
||||
+ public DimensionManager(int i, String s, String s1, BiFunction<World, DimensionManager, ? extends WorldProvider> bifunction, boolean flag, DimensionManager type) {
|
||||
this.d = i;
|
||||
this.e = s;
|
||||
this.f = s1;
|
||||
this.g = bifunction;
|
||||
this.h = flag;
|
||||
this.id = i;
|
||||
this.suffix = s;
|
||||
this.folder = s1;
|
||||
this.providerFactory = bifunction;
|
||||
this.hasSkyLight = flag;
|
||||
+ this.type = type; // CraftBukkit
|
||||
}
|
||||
|
||||
|
@ -16,10 +16,10 @@
|
||||
|
||||
if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) {
|
||||
- world.setTypeUpdate(blockposition1, iblockdata);
|
||||
- world.getBlockTickList().a(blockposition1.immutableCopy(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
|
||||
- world.getBlockTickList().a(blockposition1, Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
|
||||
+ // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition1, iblockdata, entityliving)) {
|
||||
+ world.getBlockTickList().a(blockposition1.immutableCopy(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
|
||||
+ world.getBlockTickList().a(blockposition1, Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
|
||||
+ }
|
||||
+ // CraftBukkit End
|
||||
}
|
||||
|
@ -78,14 +78,14 @@
|
||||
@@ -204,6 +263,12 @@
|
||||
}
|
||||
|
||||
protected void b(EntityPose entitypose) {
|
||||
protected void setPose(EntityPose entitypose) {
|
||||
+ // CraftBukkit start
|
||||
+ if (entitypose == this.Z()) {
|
||||
+ if (entitypose == this.getPose()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ this.world.getServer().getPluginManager().callEvent(new EntityPoseChangeEvent(this.getBukkitEntity(), Pose.values()[entitypose.ordinal()]));
|
||||
+ // CraftBukkit end
|
||||
this.datawatcher.set(Entity.X, entitypose);
|
||||
this.datawatcher.set(Entity.POSE, entitypose);
|
||||
}
|
||||
|
||||
@@ -212,6 +277,33 @@
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -294,8 +305,12 @@
|
||||
@@ -304,8 +315,12 @@
|
||||
boolean flag = movingobjectpositionblock.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && movingobjectpositionblock.getBlockPosition().equals(blockposition);
|
||||
|
||||
if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
|
||||
@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -328,8 +343,12 @@
|
||||
@@ -338,8 +353,12 @@
|
||||
IBlockData iblockdata2 = this.a.getCarried();
|
||||
|
||||
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
|
||||
|
@ -1,66 +0,0 @@
|
||||
--- a/net/minecraft/server/EntityFox.java
|
||||
+++ b/net/minecraft/server/EntityFox.java
|
||||
@@ -96,7 +96,7 @@
|
||||
this.goalSelector.a(10, new EntityFox.p());
|
||||
this.goalSelector.a(11, new EntityFox.j(this, EntityHuman.class, 24.0F));
|
||||
this.goalSelector.a(12, new EntityFox.r());
|
||||
- this.targetSelector.a(3, new EntityFox.a(EntityLiving.class, false, false, (entityliving) -> {
|
||||
+ this.targetSelector.a(3, new EntityFox.a(EntityLiving.class, false, false, (entityliving) -> { // CraftBukkit - decompile error
|
||||
return EntityFox.bF.test(entityliving) && !this.c(entityliving.getUniqueID());
|
||||
}));
|
||||
}
|
||||
@@ -260,15 +260,15 @@
|
||||
return EntityFox.Type.a((Integer) this.datawatcher.get(EntityFox.bz));
|
||||
}
|
||||
|
||||
- private void a(EntityFox.Type entityfox_type) {
|
||||
+ public void a(EntityFox.Type entityfox_type) { // PAIL
|
||||
this.datawatcher.set(EntityFox.bz, entityfox_type.c());
|
||||
}
|
||||
|
||||
private List<UUID> ek() {
|
||||
List<UUID> list = Lists.newArrayList();
|
||||
|
||||
- list.add(((Optional) this.datawatcher.get(EntityFox.bB)).orElse((Object) null));
|
||||
- list.add(((Optional) this.datawatcher.get(EntityFox.bD)).orElse((Object) null));
|
||||
+ list.add((this.datawatcher.get(EntityFox.bB)).orElse(null)); // CraftBukkit - decompile error
|
||||
+ list.add((this.datawatcher.get(EntityFox.bD)).orElse(null)); // CraftBukkit - decompile error
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
return this.r(32);
|
||||
}
|
||||
|
||||
- private void x(boolean flag) {
|
||||
+ public void x(boolean flag) { // PAIL
|
||||
this.d(32, flag);
|
||||
}
|
||||
|
||||
@@ -983,7 +983,7 @@
|
||||
private int f;
|
||||
|
||||
public r() {
|
||||
- super(null);
|
||||
+ super(); // CraftBukkit - decompile error
|
||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK));
|
||||
}
|
||||
|
||||
@@ -1035,7 +1035,7 @@
|
||||
private int c;
|
||||
|
||||
public t() {
|
||||
- super(null);
|
||||
+ super(); // CraftBukkit - decompile error
|
||||
this.c = EntityFox.this.random.nextInt(140);
|
||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK, PathfinderGoal.Type.JUMP));
|
||||
}
|
||||
@@ -1146,7 +1146,7 @@
|
||||
private EntityLiving k;
|
||||
private int l;
|
||||
|
||||
- public a(Class oclass, boolean flag, boolean flag1, Predicate predicate) {
|
||||
+ public a(Class oclass, boolean flag, boolean flag1, Predicate<EntityLiving> predicate) { // CraftBukkit - decompile error
|
||||
super(EntityFox.this, oclass, 10, flag, flag1, predicate);
|
||||
}
|
||||
|
@ -35,8 +35,8 @@
|
||||
|
||||
this.lastX = this.locX;
|
||||
this.lastY = this.locY;
|
||||
@@ -99,9 +107,11 @@
|
||||
this.setMot(this.getMot().d(1.0D, -0.5D, 1.0D));
|
||||
@@ -101,9 +109,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Craftbukkit start - moved up
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
this.impulse |= this.ax();
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -113,6 +123,12 @@
|
||||
@@ -115,6 +125,12 @@
|
||||
}
|
||||
|
||||
if (!this.world.isClientSide && this.age >= 6000) {
|
||||
@ -60,7 +60,7 @@
|
||||
this.die();
|
||||
}
|
||||
|
||||
@@ -173,13 +189,14 @@
|
||||
@@ -175,13 +191,14 @@
|
||||
}
|
||||
|
||||
private static void a(EntityItem entityitem, ItemStack itemstack, EntityItem entityitem1, ItemStack itemstack1) {
|
||||
@ -76,7 +76,7 @@
|
||||
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay);
|
||||
entityitem.age = Math.min(entityitem.age, entityitem1.age);
|
||||
if (itemstack1.isEmpty()) {
|
||||
@@ -193,7 +210,7 @@
|
||||
@@ -195,7 +212,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -85,7 +85,7 @@
|
||||
this.damageEntity(DamageSource.FIRE, (float) i);
|
||||
}
|
||||
|
||||
@@ -204,6 +221,11 @@
|
||||
@@ -206,6 +223,11 @@
|
||||
} else if (!this.getItemStack().isEmpty() && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.isExplosion()) {
|
||||
return false;
|
||||
} else {
|
||||
@ -97,7 +97,7 @@
|
||||
this.velocityChanged();
|
||||
this.f = (int) ((float) this.f - f);
|
||||
if (this.f <= 0) {
|
||||
@@ -265,6 +287,35 @@
|
||||
@@ -267,6 +289,35 @@
|
||||
Item item = itemstack.getItem();
|
||||
int i = itemstack.getCount();
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
if (this.pickupDelay == 0 && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) {
|
||||
entityhuman.receive(this, i);
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -307,7 +358,9 @@
|
||||
@@ -309,7 +360,9 @@
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemstack) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityLLamaTrader.java
|
||||
+++ b/net/minecraft/server/EntityLLamaTrader.java
|
||||
@@ -113,7 +113,7 @@
|
||||
--- a/net/minecraft/server/EntityLlamaTrader.java
|
||||
+++ b/net/minecraft/server/EntityLlamaTrader.java
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
@ -46,13 +46,4 @@
|
||||
+ // CraftBukkit end
|
||||
|
||||
for (i = 0; i < 5; ++i) {
|
||||
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY + (double) this.getHeight(), this.locZ, new ItemStack(this.dV().d.getBlock())));
|
||||
@@ -156,7 +176,7 @@
|
||||
return Pair.of(blockflowers.d(), blockflowers.e());
|
||||
}
|
||||
|
||||
- private void a(EntityMushroomCow.Type entitymushroomcow_type) {
|
||||
+ public void a(EntityMushroomCow.Type entitymushroomcow_type) { // PAIL
|
||||
this.datawatcher.set(EntityMushroomCow.bz, entitymushroomcow_type.c);
|
||||
}
|
||||
|
||||
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY + (double) this.getHeight(), this.locZ, new ItemStack(this.getVariant().d.getBlock())));
|
||||
|
@ -646,7 +646,7 @@
|
||||
this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft());
|
||||
this.setShoulderEntityRight(entityplayer.getShoulderEntityRight());
|
||||
+
|
||||
+ this.S = false; // SPIGOT-4767
|
||||
+ this.inLava = false; // SPIGOT-4767
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,7 +33,7 @@
|
||||
- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this);
|
||||
+ this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error
|
||||
this.world.getMethodProfiler().exit();
|
||||
if (!this.dX() && this.bE > 0) {
|
||||
if (!this.dY() && this.bE > 0) {
|
||||
--this.bE;
|
||||
@@ -136,7 +146,7 @@
|
||||
this.bF = false;
|
||||
@ -44,23 +44,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +257,14 @@
|
||||
@@ -258,7 +268,14 @@
|
||||
while (iterator.hasNext()) {
|
||||
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
|
||||
|
||||
- merchantrecipe.increaseUses(-MathHelper.d((float) i * merchantrecipe.m()));
|
||||
- merchantrecipe.increaseSpecialPrice(-MathHelper.d((float) i * merchantrecipe.getPriceMultiplier()));
|
||||
+ // CraftBukkit start
|
||||
+ int bonus = -MathHelper.d((float) i * merchantrecipe.m());
|
||||
+ int bonus = -MathHelper.d((float) i * merchantrecipe.getPriceMultiplier());
|
||||
+ VillagerReplenishTradeEvent event = new VillagerReplenishTradeEvent((Villager) this.getBukkitEntity(), merchantrecipe.asBukkit(), bonus);
|
||||
+ Bukkit.getPluginManager().callEvent(event);
|
||||
+ if (!event.isCancelled()) {
|
||||
+ merchantrecipe.increaseUses(event.getBonus());
|
||||
+ merchantrecipe.increaseSpecialPrice(event.getBonus());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,7 +570,12 @@
|
||||
@@ -558,7 +575,12 @@
|
||||
entitywitch.setCustomNameVisible(this.getCustomNameVisible());
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
this.die();
|
||||
}
|
||||
|
||||
@@ -725,7 +747,7 @@
|
||||
@@ -730,7 +752,7 @@
|
||||
|
||||
if (entityirongolem != null) {
|
||||
if (entityirongolem.a((GeneratorAccess) this.world, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) this.world)) {
|
||||
@ -83,12 +83,12 @@
|
||||
return entityirongolem;
|
||||
}
|
||||
|
||||
@@ -775,7 +797,7 @@
|
||||
EntityVillager.a entityvillager_a = (EntityVillager.a) this.getBehaviorController().c(MemoryModuleType.GOLEM_SPAWN_CONDITIONS).orElseGet(EntityVillager.a::new);
|
||||
@@ -780,7 +802,7 @@
|
||||
EntityVillager.a entityvillager_a = (EntityVillager.a) this.getBehaviorController().getMemory(MemoryModuleType.GOLEM_SPAWN_CONDITIONS).orElseGet(EntityVillager.a::new);
|
||||
|
||||
entityvillager_a.b(this.world.getTime());
|
||||
- this.br.a(MemoryModuleType.GOLEM_SPAWN_CONDITIONS, (Object) entityvillager_a);
|
||||
+ this.br.a(MemoryModuleType.GOLEM_SPAWN_CONDITIONS, entityvillager_a); // CraftBukkit - decompile error
|
||||
- this.br.setMemory(MemoryModuleType.GOLEM_SPAWN_CONDITIONS, (Object) entityvillager_a);
|
||||
+ this.br.setMemory(MemoryModuleType.GOLEM_SPAWN_CONDITIONS, entityvillager_a); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public static final class a {
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityVillagerAbstract.java
|
||||
+++ b/net/minecraft/server/EntityVillagerAbstract.java
|
||||
@@ -4,14 +4,29 @@
|
||||
@@ -4,15 +4,30 @@
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
@ -22,16 +22,17 @@
|
||||
+ return (craftMerchant == null) ? craftMerchant = new CraftMerchant(this) : craftMerchant;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
private static final DataWatcherObject<Integer> bA = DataWatcher.a(EntityVillagerAbstract.class, DataWatcherRegistry.b);
|
||||
@Nullable
|
||||
private EntityHuman tradingPlayer;
|
||||
@Nullable
|
||||
protected MerchantRecipeList trades;
|
||||
- private final InventorySubcontainer inventory = new InventorySubcontainer(8);
|
||||
+ private final InventorySubcontainer inventory = new InventorySubcontainer(8, (org.bukkit.craftbukkit.entity.CraftAbstractVillager) this.getBukkitEntity()); // CraftBukkit add argument
|
||||
private int bC;
|
||||
|
||||
public EntityVillagerAbstract(EntityTypes<? extends EntityVillagerAbstract> entitytypes, World world) {
|
||||
@@ -198,7 +213,16 @@
|
||||
super(entitytypes, world);
|
||||
@@ -204,7 +219,16 @@
|
||||
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random);
|
||||
|
||||
if (merchantrecipe != null) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -68,6 +73,11 @@
|
||||
@@ -66,6 +71,11 @@
|
||||
public void tick() {
|
||||
if (!this.world.isClientSide && this.isAlive() && this.isConverting()) {
|
||||
int i = this.getConversionProgress();
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
this.conversionTime -= i;
|
||||
if (this.conversionTime <= 0) {
|
||||
@@ -115,8 +125,11 @@
|
||||
@@ -113,8 +123,11 @@
|
||||
this.conversionPlayer = uuid;
|
||||
this.conversionTime = i;
|
||||
this.getDataWatcher().set(EntityZombieVillager.CONVERTING, true);
|
||||
@ -45,7 +45,7 @@
|
||||
this.world.broadcastEntityEffect(this, (byte) 16);
|
||||
}
|
||||
|
||||
@@ -135,14 +148,20 @@
|
||||
@@ -133,14 +146,20 @@
|
||||
entityvillager.setAgeRaw(-24000);
|
||||
}
|
||||
|
||||
@ -68,12 +68,12 @@
|
||||
if (this.conversionPlayer != null) {
|
||||
EntityHuman entityhuman = worldserver.b(this.conversionPlayer);
|
||||
|
||||
@@ -152,7 +171,7 @@
|
||||
@@ -150,7 +169,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0));
|
||||
+ entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); // CraftBukkit
|
||||
worldserver.a((EntityHuman) null, 1027, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0);
|
||||
worldserver.a((EntityHuman) null, 1027, new BlockPosition(this), 0);
|
||||
}
|
||||
|
||||
|
@ -18,19 +18,19 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,6 +92,11 @@
|
||||
@@ -87,6 +91,11 @@
|
||||
itemstack1 = new ItemStack(Items.ARROW);
|
||||
itemstack2 = itemstack1.cloneItemStack();
|
||||
}
|
||||
+ // CraftBukkit start - SPIGOT-4870, MC-150847
|
||||
+ else if (itemstack1.isEmpty()) {
|
||||
+ return;
|
||||
+ return false;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
a(entityliving, itemstack, itemstack1, k > 0, flag);
|
||||
}
|
||||
@@ -203,11 +212,27 @@
|
||||
if (!a(entityliving, itemstack, itemstack1, k > 0, flag)) {
|
||||
return false;
|
||||
@@ -210,11 +219,27 @@
|
||||
vector3fa.a(quaternion);
|
||||
((IProjectile) object).shoot((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c(), f1, f2);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
public ItemStack buyingItem1;
|
||||
@@ -12,6 +14,18 @@
|
||||
private int h;
|
||||
private int demand;
|
||||
public float priceMultiplier;
|
||||
public int xp;
|
||||
+ // CraftBukkit start
|
||||
|
@ -118,8 +118,8 @@
|
||||
+ WorldData worlddata = this.getConvertable().b(s); // CraftBukkit
|
||||
|
||||
if (worlddata != null) {
|
||||
- WorldUpgrader worldupgrader = new WorldUpgrader(this.getWorld(), this.getConvertable(), worlddata, this.as);
|
||||
+ WorldUpgrader worldupgrader = new WorldUpgrader(s, this.getConvertable(), worlddata, this.as); // CraftBukkit
|
||||
- WorldUpgrader worldupgrader = new WorldUpgrader(this.getWorld(), this.getConvertable(), worlddata, this.eraseCache);
|
||||
+ WorldUpgrader worldupgrader = new WorldUpgrader(s, this.getConvertable(), worlddata, this.eraseCache); // CraftBukkit
|
||||
IChatBaseComponent ichatbasecomponent = null;
|
||||
|
||||
while (!worldupgrader.b()) {
|
||||
@ -359,15 +359,15 @@
|
||||
chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
|
||||
|
||||
while (chunkproviderserver.b() != 441) {
|
||||
- this.nextTick += 100L;
|
||||
- this.nextTick = SystemUtils.getMonotonicMillis() + 10L;
|
||||
- this.sleepForTick();
|
||||
+ // CraftBukkit start
|
||||
+ // this.nextTick += 100L;
|
||||
+ // this.nextTick = SystemUtils.getMonotonicMillis() + 10L;
|
||||
+ this.executeModerately();
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
- this.nextTick += 100L;
|
||||
- this.nextTick = SystemUtils.getMonotonicMillis() + 10L;
|
||||
- this.sleepForTick();
|
||||
- Iterator iterator = DimensionManager.a().iterator();
|
||||
-
|
||||
@ -375,7 +375,7 @@
|
||||
- DimensionManager dimensionmanager = (DimensionManager) iterator.next();
|
||||
- ForcedChunk forcedchunk = (ForcedChunk) this.getWorldServer(dimensionmanager).getWorldPersistentData().b(ForcedChunk::new, "chunks");
|
||||
+ // CraftBukkit start
|
||||
+ // this.nextTick += 100L;
|
||||
+ // this.nextTick = SystemUtils.getMonotonicMillis() + 10L;
|
||||
+ this.executeModerately();
|
||||
+ // Iterator iterator = DimensionManager.a().iterator();
|
||||
+
|
||||
@ -390,10 +390,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
- this.nextTick += 100L;
|
||||
- this.nextTick = SystemUtils.getMonotonicMillis() + 10L;
|
||||
- this.sleepForTick();
|
||||
+ // CraftBukkit start
|
||||
+ // this.nextTick += 100L;
|
||||
+ // this.nextTick = SystemUtils.getMonotonicMillis() + 10L;
|
||||
+ this.executeModerately();
|
||||
+ // CraftBukkit end
|
||||
worldloadlistener.b();
|
||||
@ -635,7 +635,7 @@
|
||||
+ }
|
||||
+
|
||||
+ if (optionset.has("eraseCache")) {
|
||||
+ dedicatedserver.c(true);
|
||||
+ dedicatedserver.setEraseCache(true);
|
||||
+ }
|
||||
+
|
||||
+ dedicatedserver.serverThread.start();
|
||||
|
@ -3,7 +3,7 @@
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
public void setMobName(EntityTypes<?> entitytypes) {
|
||||
this.spawnData.b().setString("id", IRegistry.ENTITY_TYPE.getKey(entitytypes).toString());
|
||||
this.spawnData.getEntity().setString("id", IRegistry.ENTITY_TYPE.getKey(entitytypes).toString());
|
||||
+ this.mobs.clear(); // CraftBukkit - SPIGOT-3496, MC-92282
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
private static final Predicate<IBlockData> a = BlockStatePredicate.a(Blocks.GRASS);
|
||||
@@ -55,7 +59,8 @@
|
||||
BlockPosition blockposition = new BlockPosition(this.b.locX, this.b.locY, this.b.locZ);
|
||||
BlockPosition blockposition = new BlockPosition(this.b);
|
||||
|
||||
if (PathfinderGoalEatTile.a.test(this.c.getType(blockposition))) {
|
||||
- if (this.c.getGameRules().getBoolean("mobGriefing")) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalSit.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalSit.java
|
||||
@@ -15,7 +15,7 @@
|
||||
@@ -20,7 +20,7 @@
|
||||
@Override
|
||||
public boolean a() {
|
||||
if (!this.entity.isTamed()) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/server/PlayerChunk.java
|
||||
+++ b/net/minecraft/server/PlayerChunk.java
|
||||
@@ -41,7 +41,7 @@
|
||||
this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size());
|
||||
@@ -43,7 +43,7 @@
|
||||
this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
|
||||
this.tickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
|
||||
this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
|
||||
- this.chunkSave = CompletableFuture.completedFuture((Object) null);
|
||||
@ -9,7 +9,7 @@
|
||||
this.dirtyBlocks = new short[64];
|
||||
this.location = chunkcoordintpair;
|
||||
this.lightEngine = lightengine;
|
||||
@@ -74,9 +74,9 @@
|
||||
@@ -76,9 +76,9 @@
|
||||
@Nullable
|
||||
public Chunk getChunk() {
|
||||
CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture = this.a();
|
||||
@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
public CompletableFuture<IChunkAccess> getChunkSave() {
|
||||
@@ -199,7 +199,7 @@
|
||||
@@ -201,7 +201,7 @@
|
||||
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(i);
|
||||
|
||||
if (completablefuture != null) {
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
if (either == null || either.left().isPresent()) {
|
||||
return completablefuture;
|
||||
@@ -211,6 +211,15 @@
|
||||
@@ -213,6 +213,15 @@
|
||||
|
||||
this.a(completablefuture1);
|
||||
this.statusFutures.set(i, completablefuture1);
|
||||
@ -46,3 +46,12 @@
|
||||
return completablefuture1;
|
||||
} else {
|
||||
return completablefuture == null ? PlayerChunk.UNLOADED_CHUNK_ACCESS_FUTURE : completablefuture;
|
||||
@@ -294,7 +303,7 @@
|
||||
if (flag2 && !flag3) {
|
||||
completablefuture = this.fullChunkFuture;
|
||||
this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
|
||||
- this.a(completablefuture.thenApply((either1) -> {
|
||||
+ this.a(((CompletableFuture<Either<Chunk, PlayerChunk.Failure>>) completablefuture).thenApply((either1) -> { // CraftBukkit - decompile error
|
||||
playerchunkmap.getClass();
|
||||
return either1.ifLeft(playerchunkmap::a);
|
||||
}));
|
||||
|
@ -1,19 +1,17 @@
|
||||
--- a/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -33,6 +33,12 @@
|
||||
import javax.annotation.Nullable;
|
||||
@@ -35,6 +35,10 @@
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
+import org.bukkit.event.world.ChunkUnloadEvent;
|
||||
+// CraftBukkit end
|
||||
|
||||
public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
|
||||
@@ -179,9 +185,12 @@
|
||||
@@ -181,9 +185,12 @@
|
||||
|
||||
return completablefuture1.thenApply((list1) -> {
|
||||
List<IChunkAccess> list2 = Lists.newArrayList();
|
||||
@ -28,19 +26,16 @@
|
||||
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
|
||||
Optional<IChunkAccess> optional = either.left();
|
||||
|
||||
@@ -257,9 +266,9 @@
|
||||
}).forEach((completablefuture) -> {
|
||||
if (flag) {
|
||||
this.executor.awaitTasks(completablefuture::isDone);
|
||||
- ((Either) completablefuture.join()).ifLeft(this::saveChunk);
|
||||
+ (completablefuture.join()).ifLeft(this::saveChunk); // CraftBukkit - decompile error
|
||||
} else {
|
||||
- ((Either) completablefuture.getNow(PlayerChunk.UNLOADED_CHUNK_ACCESS)).ifLeft(this::saveChunk);
|
||||
+ (completablefuture.getNow(PlayerChunk.UNLOADED_CHUNK_ACCESS)).ifLeft(this::saveChunk); // CraftBukkit - decompile error
|
||||
}
|
||||
@@ -279,7 +286,7 @@
|
||||
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.x.getName());
|
||||
} else {
|
||||
this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
|
||||
- IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow((Object) null);
|
||||
+ IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow(null); // CraftBukkit - decompile error
|
||||
|
||||
});
|
||||
@@ -268,7 +277,6 @@
|
||||
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
|
||||
this.saveChunk(ichunkaccess);
|
||||
@@ -290,7 +297,6 @@
|
||||
}
|
||||
|
||||
}
|
||||
@ -48,12 +43,8 @@
|
||||
protected void unloadChunks(BooleanSupplier booleansupplier) {
|
||||
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
|
||||
|
||||
@@ -304,13 +312,22 @@
|
||||
this.a(i, playerchunk);
|
||||
} else {
|
||||
if (this.g.remove(i, playerchunk) && ichunkaccess != null) {
|
||||
- this.saveChunk(ichunkaccess);
|
||||
if (this.h.remove(i) && ichunkaccess instanceof Chunk) {
|
||||
@@ -330,9 +336,19 @@
|
||||
if (this.loadedChunks.remove(i) && ichunkaccess instanceof Chunk) {
|
||||
Chunk chunk = (Chunk) ichunkaccess;
|
||||
|
||||
+ // CraftBukkit start
|
||||
@ -62,7 +53,7 @@
|
||||
+ this.saveChunk(ichunkaccess, event.isSaveChunk());
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
chunk.c(false);
|
||||
chunk.setLoaded(false);
|
||||
this.world.unloadChunk(chunk);
|
||||
+ // CraftBukkit start
|
||||
+ } else {
|
||||
@ -72,7 +63,7 @@
|
||||
|
||||
this.lightEngine.a(ichunkaccess.getPos());
|
||||
this.lightEngine.queueUpdate();
|
||||
@@ -394,7 +411,7 @@
|
||||
@@ -416,7 +432,7 @@
|
||||
return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
|
||||
});
|
||||
}, (runnable) -> {
|
||||
@ -81,16 +72,16 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -476,7 +493,7 @@
|
||||
@@ -498,7 +514,7 @@
|
||||
long i = playerchunk.h().pair();
|
||||
|
||||
playerchunk.getClass();
|
||||
- mailbox.a((Object) ChunkTaskQueueSorter.a(runnable, i, playerchunk::i));
|
||||
+ mailbox.a(ChunkTaskQueueSorter.a(runnable, i, playerchunk::i)); // CraftBukkit - decompile error
|
||||
- mailbox.a((Object) ChunkTaskQueueSorter.a(runnable, i, playerchunk::getTicketLevel));
|
||||
+ mailbox.a(ChunkTaskQueueSorter.a(runnable, i, playerchunk::getTicketLevel)); // CraftBukkit - decompile error
|
||||
});
|
||||
}
|
||||
|
||||
@@ -493,7 +510,7 @@
|
||||
@@ -515,7 +531,7 @@
|
||||
return Either.left(chunk);
|
||||
});
|
||||
}, (runnable) -> {
|
||||
@ -99,7 +90,7 @@
|
||||
});
|
||||
|
||||
completablefuture1.thenAcceptAsync((either) -> {
|
||||
@@ -507,7 +524,7 @@
|
||||
@@ -529,7 +545,7 @@
|
||||
return Either.left(chunk);
|
||||
});
|
||||
}, (runnable) -> {
|
||||
@ -108,23 +99,32 @@
|
||||
});
|
||||
return completablefuture1;
|
||||
}
|
||||
@@ -517,8 +534,14 @@
|
||||
@@ -543,7 +559,7 @@
|
||||
return chunk;
|
||||
});
|
||||
}, (runnable) -> {
|
||||
- this.mailboxMain.a((Object) ChunkTaskQueueSorter.a(playerchunk, runnable));
|
||||
+ this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error
|
||||
});
|
||||
}
|
||||
|
||||
public void saveChunk(IChunkAccess ichunkaccess) {
|
||||
@@ -552,8 +568,14 @@
|
||||
}
|
||||
|
||||
public boolean saveChunk(IChunkAccess ichunkaccess) {
|
||||
+ // CraftBukkit start
|
||||
+ this.saveChunk(ichunkaccess, ichunkaccess.isNeedsSaving());
|
||||
+ return this.saveChunk(ichunkaccess, ichunkaccess.isNeedsSaving());
|
||||
+ }
|
||||
+
|
||||
+ public void saveChunk(IChunkAccess ichunkaccess, boolean save) {
|
||||
+ public boolean saveChunk(IChunkAccess ichunkaccess, boolean save) {
|
||||
+ // CraftBukkit end
|
||||
this.n.a(ichunkaccess.getPos());
|
||||
- if (ichunkaccess.isNeedsSaving()) {
|
||||
+ if (save) { // CraftBukkit
|
||||
- if (!ichunkaccess.isNeedsSaving()) {
|
||||
+ if (!save) { // CraftBukkit
|
||||
return false;
|
||||
} else {
|
||||
try {
|
||||
this.world.checkSession();
|
||||
} catch (ExceptionWorldConflict exceptionworldconflict) {
|
||||
@@ -569,9 +592,10 @@
|
||||
@@ -607,9 +629,10 @@
|
||||
ChunkCoordIntPair chunkcoordintpair = playerchunk.h();
|
||||
Packet<?>[] apacket = new Packet[2];
|
||||
|
||||
@ -133,11 +133,11 @@
|
||||
int i1 = b(chunkcoordintpair, entityplayer, true);
|
||||
- boolean flag = i1 <= l;
|
||||
+ boolean flag = i1 <= finall; // CraftBukkit - decompile error
|
||||
boolean flag1 = i1 <= this.A;
|
||||
boolean flag1 = i1 <= this.viewDistance;
|
||||
|
||||
this.sendChunk(entityplayer, chunkcoordintpair, apacket, flag, flag1);
|
||||
@@ -626,7 +650,7 @@
|
||||
private NBTTagCompound f(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||
@@ -664,7 +687,7 @@
|
||||
private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
||||
|
||||
- return nbttagcompound == null ? null : this.getChunkData(this.world.getWorldProvider().getDimensionManager(), this.m, nbttagcompound);
|
||||
@ -145,7 +145,7 @@
|
||||
}
|
||||
|
||||
boolean d(ChunkCoordIntPair chunkcoordintpair) {
|
||||
@@ -946,7 +970,7 @@
|
||||
@@ -984,7 +1007,7 @@
|
||||
public final Set<EntityPlayer> trackedPlayers = Sets.newHashSet();
|
||||
|
||||
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
||||
@ -154,7 +154,7 @@
|
||||
this.tracker = entity;
|
||||
this.trackingDistance = i;
|
||||
this.e = SectionPosition.a(entity);
|
||||
@@ -1015,6 +1039,17 @@
|
||||
@@ -1053,6 +1076,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,9 +99,9 @@
|
||||
this.a(entityplayer, (EntityPlayer) null, worldserver);
|
||||
PlayerConnection playerconnection = new PlayerConnection(this.server, networkmanager, entityplayer);
|
||||
|
||||
- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager(), this.getMaxPlayers(), worlddata.getType(), this.s, worldserver.getGameRules().getBoolean("reducedDebugInfo")));
|
||||
- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager(), this.getMaxPlayers(), worlddata.getType(), this.viewDistance, worldserver.getGameRules().getBoolean("reducedDebugInfo")));
|
||||
+ // CraftBukkit - getType()
|
||||
+ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getType(), this.getMaxPlayers(), worlddata.getType(), this.s, worldserver.getGameRules().getBoolean("reducedDebugInfo")));
|
||||
+ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getType(), this.getMaxPlayers(), worlddata.getType(), this.viewDistance, worldserver.getGameRules().getBoolean("reducedDebugInfo")));
|
||||
+ entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
||||
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
|
||||
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
||||
@ -637,7 +637,7 @@
|
||||
+ // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, worldserver.h(1.0F)));
|
||||
+ // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, worldserver.f(1.0F)));
|
||||
+ entityplayer.setPlayerWeather(org.bukkit.WeatherType.DOWNFALL, false);
|
||||
+ entityplayer.updateWeather(-worldserver.l, worldserver.l, -worldserver.n, worldserver.n);
|
||||
+ entityplayer.updateWeather(-worldserver.rainLevel, worldserver.rainLevel, -worldserver.thunderLevel, worldserver.thunderLevel);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
|
@ -1,25 +1,7 @@
|
||||
--- a/net/minecraft/server/TickListServer.java
|
||||
+++ b/net/minecraft/server/TickListServer.java
|
||||
@@ -12,14 +12,15 @@
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
+import org.bukkit.craftbukkit.util.HashTreeSet; // CraftBukkit
|
||||
|
||||
public class TickListServer<T> implements TickList<T> {
|
||||
|
||||
protected final Predicate<T> a;
|
||||
protected final Function<T, MinecraftKey> b;
|
||||
protected final Function<MinecraftKey, T> c;
|
||||
- protected final Set<NextTickListEntry<T>> nextTickListHash = Sets.newHashSet();
|
||||
- protected final TreeSet<NextTickListEntry<T>> nextTickList = new TreeSet();
|
||||
+ // protected final Set<NextTickListEntry<T>> nextTickListHash = Sets.newHashSet();
|
||||
+ protected final HashTreeSet<NextTickListEntry> nextTickList = new HashTreeSet<>(); // CraftBukkit - HashTreeSet
|
||||
private final WorldServer f;
|
||||
private final List<NextTickListEntry<T>> g = Lists.newArrayList();
|
||||
private final Consumer<NextTickListEntry<T>> h;
|
||||
@@ -35,16 +36,22 @@
|
||||
public void a() {
|
||||
@@ -37,11 +37,17 @@
|
||||
this.b();
|
||||
int i = this.nextTickList.size();
|
||||
|
||||
- if (i != this.nextTickListHash.size()) {
|
||||
@ -37,48 +19,4 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
this.f.getMethodProfiler().enter("cleaning");
|
||||
|
||||
- NextTickListEntry nextticklistentry;
|
||||
+ NextTickListEntry<T> nextticklistentry; // CraftBukkit - decompile error
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
nextticklistentry = (NextTickListEntry) this.nextTickList.first();
|
||||
@@ -53,7 +60,7 @@
|
||||
}
|
||||
|
||||
this.nextTickList.remove(nextticklistentry);
|
||||
- this.nextTickListHash.remove(nextticklistentry);
|
||||
+ // this.nextTickListHash.remove(nextticklistentry); // CraftBukkit - use nextTickList
|
||||
this.g.add(nextticklistentry);
|
||||
}
|
||||
|
||||
@@ -122,7 +129,7 @@
|
||||
if (blockposition.getX() >= structureboundingbox.a && blockposition.getX() < structureboundingbox.d && blockposition.getZ() >= structureboundingbox.c && blockposition.getZ() < structureboundingbox.f) {
|
||||
if (flag) {
|
||||
if (i == 0) {
|
||||
- this.nextTickListHash.remove(nextticklistentry);
|
||||
+ // this.nextTickListHash.remove(nextticklistentry); // CraftBukkit - removed
|
||||
}
|
||||
|
||||
iterator.remove();
|
||||
@@ -196,7 +203,7 @@
|
||||
|
||||
@Override
|
||||
public boolean a(BlockPosition blockposition, T t0) {
|
||||
- return this.nextTickListHash.contains(new NextTickListEntry<>(blockposition, t0));
|
||||
+ return this.nextTickList.contains(new NextTickListEntry<>(blockposition, t0)); // CraftBukkit
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -220,8 +227,8 @@
|
||||
}
|
||||
|
||||
private void a(NextTickListEntry<T> nextticklistentry) {
|
||||
- if (!this.nextTickListHash.contains(nextticklistentry)) {
|
||||
- this.nextTickListHash.add(nextticklistentry);
|
||||
+ // CraftBukkit - use nextTickList
|
||||
+ if (!this.nextTickList.contains(nextticklistentry)) {
|
||||
this.nextTickList.add(nextticklistentry);
|
||||
}
|
||||
|
||||
this.h.getMethodProfiler().enter("selecting");
|
||||
|
@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/server/TileEntity.java
|
||||
+++ b/net/minecraft/server/TileEntity.java
|
||||
@@ -3,9 +3,18 @@
|
||||
import javax.annotation.Nullable;
|
||||
@@ -4,9 +4,18 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.util.Supplier;
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
|
||||
+import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry;
|
||||
@ -19,7 +19,7 @@
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private final TileEntityTypes<?> b;
|
||||
@Nullable
|
||||
@@ -35,6 +44,12 @@
|
||||
@@ -37,6 +46,12 @@
|
||||
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
this.position = new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z"));
|
||||
@ -32,7 +32,7 @@
|
||||
}
|
||||
|
||||
public NBTTagCompound save(NBTTagCompound nbttagcompound) {
|
||||
@@ -51,12 +66,24 @@
|
||||
@@ -53,12 +68,24 @@
|
||||
nbttagcompound.setInt("x", this.position.getX());
|
||||
nbttagcompound.setInt("y", this.position.getY());
|
||||
nbttagcompound.setInt("z", this.position.getZ());
|
||||
@ -57,7 +57,7 @@
|
||||
String s = nbttagcompound.getString("id");
|
||||
|
||||
return (TileEntity) IRegistry.BLOCK_ENTITY_TYPE.getOptional(new MinecraftKey(s)).map((tileentitytypes) -> {
|
||||
@@ -68,6 +95,7 @@
|
||||
@@ -70,6 +97,7 @@
|
||||
}
|
||||
}).map((tileentity) -> {
|
||||
try {
|
||||
@ -65,9 +65,9 @@
|
||||
tileentity.load(nbttagcompound);
|
||||
return tileentity;
|
||||
} catch (Throwable throwable) {
|
||||
@@ -157,4 +185,13 @@
|
||||
public TileEntityTypes<?> q() {
|
||||
return this.b;
|
||||
@@ -168,4 +196,13 @@
|
||||
}, this::getPosition});
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start - add method
|
||||
|
@ -61,7 +61,7 @@
|
||||
+ {
|
||||
+ double d0 = (double) (this.levels * 10 + 10);
|
||||
+
|
||||
AxisAlignedBB axisalignedbb = (new AxisAlignedBB(this.position)).g(d0).b(0.0D, (double) this.world.getHeight(), 0.0D);
|
||||
AxisAlignedBB axisalignedbb = (new AxisAlignedBB(this.position)).g(d0).b(0.0D, (double) this.world.getBuildHeight(), 0.0D);
|
||||
List<EntityHuman> list = this.world.a(EntityHuman.class, axisalignedbb);
|
||||
+
|
||||
+ return list;
|
||||
|
@ -92,10 +92,10 @@
|
||||
+ // CraftBukkit end
|
||||
|
||||
if (flag2 && flag) {
|
||||
this.s();
|
||||
this.t();
|
||||
@@ -168,6 +224,16 @@
|
||||
|
||||
private void s() {
|
||||
private void t() {
|
||||
ItemStack itemstack = (ItemStack) this.items.get(3);
|
||||
+ // CraftBukkit start
|
||||
+ InventoryHolder owner = this.getOwner();
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
public class TileEntityCampfire extends TileEntity implements Clearable, ITickable {
|
||||
|
||||
@@ -59,6 +64,20 @@
|
||||
@@ -55,6 +60,20 @@
|
||||
}).orElse(itemstack);
|
||||
BlockPosition blockposition = this.getPosition();
|
||||
|
||||
@ -32,4 +32,4 @@
|
||||
+ // CraftBukkit end
|
||||
InventoryUtils.dropItem(this.world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1);
|
||||
this.items.set(i, ItemStack.a);
|
||||
this.s();
|
||||
this.t();
|
||||
|
@ -21,11 +21,11 @@
|
||||
}
|
||||
|
||||
@@ -175,7 +179,7 @@
|
||||
this.target = this.v();
|
||||
this.target = this.x();
|
||||
this.k = null;
|
||||
} else if (this.target == null) {
|
||||
- List<EntityLiving> list = this.world.a(EntityLiving.class, this.u(), (entityliving1) -> {
|
||||
+ List<EntityLiving> list = this.world.a(EntityLiving.class, this.u(), (java.util.function.Predicate<EntityLiving>) (entityliving1) -> { // CraftBukkit - decompile error
|
||||
- List<EntityLiving> list = this.world.a(EntityLiving.class, this.v(), (entityliving1) -> {
|
||||
+ List<EntityLiving> list = this.world.a(EntityLiving.class, this.v(), (java.util.function.Predicate<EntityLiving>) (entityliving1) -> { // CraftBukkit - decompile error
|
||||
return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain();
|
||||
});
|
||||
|
||||
@ -48,9 +48,9 @@
|
||||
@@ -221,7 +230,7 @@
|
||||
|
||||
@Nullable
|
||||
private EntityLiving v() {
|
||||
- List<EntityLiving> list = this.world.a(EntityLiving.class, this.u(), (entityliving) -> {
|
||||
+ List<EntityLiving> list = this.world.a(EntityLiving.class, this.u(), (java.util.function.Predicate<EntityLiving>) (entityliving) -> { // CraftBukkit - decompile error
|
||||
private EntityLiving x() {
|
||||
- List<EntityLiving> list = this.world.a(EntityLiving.class, this.v(), (entityliving) -> {
|
||||
+ List<EntityLiving> list = this.world.a(EntityLiving.class, this.v(), (java.util.function.Predicate<EntityLiving>) (entityliving) -> { // CraftBukkit - decompile error
|
||||
return entityliving.getUniqueID().equals(this.k);
|
||||
});
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
@@ -119,6 +125,26 @@
|
||||
if (this.exitPortal != null) {
|
||||
BlockPosition blockposition = this.exactTeleport ? this.exitPortal : this.s();
|
||||
BlockPosition blockposition = this.exactTeleport ? this.exitPortal : this.t();
|
||||
|
||||
+ // CraftBukkit start - Fire PlayerTeleportEvent
|
||||
+ if (entity instanceof EntityPlayer) {
|
||||
|
@ -52,7 +52,7 @@
|
||||
public TileEntityHopper() {
|
||||
super(TileEntityTypes.HOPPER);
|
||||
this.items = NonNullList.a(5, ItemStack.a);
|
||||
@@ -161,7 +200,28 @@
|
||||
@@ -159,7 +198,28 @@
|
||||
for (int i = 0; i < this.getSize(); ++i) {
|
||||
if (!this.getItem(i).isEmpty()) {
|
||||
ItemStack itemstack = this.getItem(i).cloneItemStack();
|
||||
@ -82,7 +82,7 @@
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
iinventory.update();
|
||||
@@ -226,7 +286,34 @@
|
||||
@@ -224,7 +284,34 @@
|
||||
|
||||
if (!itemstack.isEmpty() && b(iinventory, itemstack, i, enumdirection)) {
|
||||
ItemStack itemstack1 = itemstack.cloneItemStack();
|
||||
@ -118,7 +118,7 @@
|
||||
|
||||
if (itemstack2.isEmpty()) {
|
||||
iinventory.update();
|
||||
@@ -241,6 +328,13 @@
|
||||
@@ -239,6 +326,13 @@
|
||||
|
||||
public static boolean a(IInventory iinventory, EntityItem entityitem) {
|
||||
boolean flag = false;
|
||||
|
@ -19,12 +19,12 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
nbttagcompound.setString("Color", this.l.b());
|
||||
nbttagcompound.setString("Color", this.color.b());
|
||||
return nbttagcompound;
|
||||
}
|
||||
@@ -39,18 +45,38 @@
|
||||
super.load(nbttagcompound);
|
||||
this.l = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK);
|
||||
this.color = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK);
|
||||
|
||||
+ // CraftBukkit start - Add an option to convert signs correctly
|
||||
+ // This is done with a flag instead of all the time because
|
||||
@ -34,13 +34,13 @@
|
||||
+
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
String s = nbttagcompound.getString("Text" + (i + 1));
|
||||
- IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s);
|
||||
- IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s.isEmpty() ? "\"\"" : s);
|
||||
+ if (s != null && s.length() > 2048) {
|
||||
+ s = "\"\"";
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s);
|
||||
+ IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s.isEmpty() ? "\"\"" : s);
|
||||
|
||||
- if (this.world instanceof WorldServer) {
|
||||
- try {
|
||||
@ -106,4 +106,4 @@
|
||||
+ return new CommandListenerWrapper(this, new Vec3D((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D), Vec2F.a, (WorldServer) this.world, 2, s, (IChatBaseComponent) object, this.world.getMinecraftServer(), entityplayer);
|
||||
}
|
||||
|
||||
public EnumColor f() {
|
||||
public EnumColor getColor() {
|
||||
|
@ -79,7 +79,7 @@
|
||||
@@ -49,6 +109,35 @@
|
||||
this.isClientSide = flag;
|
||||
this.worldBorder = this.worldProvider.getWorldBorder();
|
||||
this.c = Thread.currentThread();
|
||||
this.serverThread = Thread.currentThread();
|
||||
+ // CraftBukkit start
|
||||
+ getWorldBorder().world = (WorldServer) this;
|
||||
+ // From PlayerList.setPlayerFileData
|
||||
@ -136,7 +136,7 @@
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (isInsideWorld(blockposition)) {
|
||||
if (isOutsideWorld(blockposition)) {
|
||||
return false;
|
||||
} else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||
@@ -126,9 +235,23 @@
|
||||
@ -283,10 +283,10 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (isInsideWorld(blockposition)) {
|
||||
if (isOutsideWorld(blockposition)) {
|
||||
return Blocks.VOID_AIR.getBlockData();
|
||||
} else {
|
||||
@@ -454,9 +658,11 @@
|
||||
@@ -459,9 +663,11 @@
|
||||
TileEntity tileentity1 = (TileEntity) this.tileEntityListPending.get(i);
|
||||
|
||||
if (!tileentity1.isRemoved()) {
|
||||
@ -298,7 +298,7 @@
|
||||
|
||||
if (this.isLoaded(tileentity1.getPosition())) {
|
||||
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
|
||||
@@ -464,6 +670,12 @@
|
||||
@@ -469,6 +675,12 @@
|
||||
|
||||
chunk.setTileEntity(tileentity1.getPosition(), tileentity1);
|
||||
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
|
||||
@ -311,7 +311,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -626,6 +838,7 @@
|
||||
@@ -631,6 +843,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -319,8 +319,8 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity getTileEntity(BlockPosition blockposition) {
|
||||
@@ -634,6 +847,12 @@
|
||||
} else if (!this.isClientSide && Thread.currentThread() != this.c) {
|
||||
@@ -639,6 +852,12 @@
|
||||
} else if (!this.isClientSide && Thread.currentThread() != this.serverThread) {
|
||||
return null;
|
||||
} else {
|
||||
+ // CraftBukkit start
|
||||
@ -332,9 +332,9 @@
|
||||
TileEntity tileentity = null;
|
||||
|
||||
if (this.tickingTileEntities) {
|
||||
@@ -668,6 +887,14 @@
|
||||
@@ -673,6 +892,14 @@
|
||||
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
|
||||
if (!isInsideWorld(blockposition)) {
|
||||
if (!isOutsideWorld(blockposition)) {
|
||||
if (tileentity != null && !tileentity.isRemoved()) {
|
||||
+ // CraftBukkit start
|
||||
+ if (captureBlockStates) {
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
public void setThundering(boolean flag) {
|
||||
+ // CraftBukkit start
|
||||
+ if (this.z == flag) {
|
||||
+ if (this.thundering == flag) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
@ -46,7 +46,7 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.z = flag;
|
||||
this.thundering = flag;
|
||||
}
|
||||
|
||||
@@ -524,6 +545,20 @@
|
||||
@ -54,7 +54,7 @@
|
||||
|
||||
public void setStorm(boolean flag) {
|
||||
+ // CraftBukkit start
|
||||
+ if (this.x == flag) {
|
||||
+ if (this.raining == flag) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
@ -67,7 +67,7 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.x = flag;
|
||||
this.raining = flag;
|
||||
}
|
||||
|
||||
@@ -673,6 +708,12 @@
|
||||
|
@ -1,19 +1,13 @@
|
||||
--- a/net/minecraft/server/WorldServer.java
|
||||
+++ b/net/minecraft/server/WorldServer.java
|
||||
@@ -31,6 +31,21 @@
|
||||
@@ -30,6 +30,15 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.logging.Level;
|
||||
+import org.bukkit.Bukkit;
|
||||
+
|
||||
+import org.bukkit.WeatherType;
|
||||
+import org.bukkit.block.BlockState;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.craftbukkit.util.HashTreeSet;
|
||||
+
|
||||
+import org.bukkit.event.block.BlockFormEvent;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
+import org.bukkit.event.server.MapInitializeEvent;
|
||||
+import org.bukkit.event.weather.LightningStrikeEvent;
|
||||
@ -22,7 +16,7 @@
|
||||
public class WorldServer extends World {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -56,12 +71,29 @@
|
||||
@@ -55,12 +64,29 @@
|
||||
@Nullable
|
||||
private final MobSpawnerTrader mobSpawnerTrader;
|
||||
|
||||
@ -55,7 +49,7 @@
|
||||
this.nextTickListBlock = new TickListServer<>(this, (block) -> {
|
||||
return block == null || block.getBlockData().isAir();
|
||||
}, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b);
|
||||
@@ -84,7 +116,8 @@
|
||||
@@ -83,7 +109,8 @@
|
||||
this.getWorldData().setGameType(minecraftserver.getGamemode());
|
||||
}
|
||||
|
||||
@ -65,17 +59,17 @@
|
||||
}
|
||||
|
||||
public void doTick(BooleanSupplier booleansupplier) {
|
||||
@@ -161,6 +194,7 @@
|
||||
this.m = MathHelper.a(this.m, 0.0F, 1.0F);
|
||||
@@ -160,6 +187,7 @@
|
||||
this.rainLevel = MathHelper.a(this.rainLevel, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
+ /* CraftBukkit start
|
||||
if (this.l != this.m) {
|
||||
this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.m)), this.worldProvider.getDimensionManager());
|
||||
if (this.lastRainLevel != this.rainLevel) {
|
||||
this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.rainLevel)), this.worldProvider.getDimensionManager());
|
||||
}
|
||||
@@ -179,13 +213,34 @@
|
||||
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.m));
|
||||
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.o));
|
||||
@@ -178,13 +206,34 @@
|
||||
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.rainLevel));
|
||||
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.thunderLevel));
|
||||
}
|
||||
+ // */
|
||||
+ for (int idx = 0; idx < this.players.size(); ++idx) {
|
||||
@ -94,7 +88,7 @@
|
||||
+ }
|
||||
+ for (int idx = 0; idx < this.players.size(); ++idx) {
|
||||
+ if (((EntityPlayer) this.players.get(idx)).world == this) {
|
||||
+ ((EntityPlayer) this.players.get(idx)).updateWeather(this.l, this.m, this.n, this.o);
|
||||
+ ((EntityPlayer) this.players.get(idx)).updateWeather(this.lastRainLevel, this.rainLevel, this.lastThunderLevel, this.thunderLevel);
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
@ -109,7 +103,7 @@
|
||||
})) {
|
||||
this.D = false;
|
||||
if (this.getGameRules().getBoolean("doDaylightCycle")) {
|
||||
@@ -226,7 +281,7 @@
|
||||
@@ -225,7 +274,7 @@
|
||||
this.ae();
|
||||
this.ticking = false;
|
||||
gameprofilerfiller.exitEnter("entities");
|
||||
@ -118,7 +112,7 @@
|
||||
|
||||
if (flag3) {
|
||||
this.resetEmptyTime();
|
||||
@@ -240,6 +295,11 @@
|
||||
@@ -239,6 +288,11 @@
|
||||
|
||||
for (i = 0; i < this.globalEntityList.size(); ++i) {
|
||||
entity = (Entity) this.globalEntityList.get(i);
|
||||
@ -130,7 +124,7 @@
|
||||
this.a((entity1) -> {
|
||||
++entity1.ticksLived;
|
||||
entity1.tick();
|
||||
@@ -258,6 +318,7 @@
|
||||
@@ -257,6 +311,7 @@
|
||||
Entity entity1 = (Entity) entry.getValue();
|
||||
Entity entity2 = entity1.getVehicle();
|
||||
|
||||
@ -138,7 +132,7 @@
|
||||
if (!this.server.getSpawnAnimals() && (entity1 instanceof EntityAnimal || entity1 instanceof EntityWaterAnimal)) {
|
||||
entity1.die();
|
||||
}
|
||||
@@ -265,6 +326,7 @@
|
||||
@@ -264,6 +319,7 @@
|
||||
if (!this.server.getSpawnNPCs() && entity1 instanceof NPC) {
|
||||
entity1.die();
|
||||
}
|
||||
@ -146,7 +140,7 @@
|
||||
|
||||
if (entity2 != null) {
|
||||
if (!entity2.dead && entity2.w(entity1)) {
|
||||
@@ -325,10 +387,10 @@
|
||||
@@ -324,10 +380,10 @@
|
||||
entityhorseskeleton.r(true);
|
||||
entityhorseskeleton.setAgeRaw(0);
|
||||
entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
@ -159,7 +153,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,11 +401,11 @@
|
||||
@@ -338,11 +394,11 @@
|
||||
BiomeBase biomebase = this.getBiome(blockposition);
|
||||
|
||||
if (biomebase.a((IWorldReader) this, blockposition1)) {
|
||||
@ -173,16 +167,16 @@
|
||||
}
|
||||
|
||||
if (flag && this.getBiome(blockposition1).b() == BiomeBase.Precipitation.RAIN) {
|
||||
@@ -390,7 +452,7 @@
|
||||
@@ -389,7 +445,7 @@
|
||||
protected BlockPosition a(BlockPosition blockposition) {
|
||||
BlockPosition blockposition1 = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, blockposition);
|
||||
AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getHeight(), blockposition1.getZ()))).g(3.0D);
|
||||
AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getBuildHeight(), blockposition1.getZ()))).g(3.0D);
|
||||
- List<EntityLiving> list = this.a(EntityLiving.class, axisalignedbb, (entityliving) -> {
|
||||
+ List<EntityLiving> list = this.a(EntityLiving.class, axisalignedbb, (java.util.function.Predicate<EntityLiving>) (entityliving) -> { // CraftBukkit - decompile error
|
||||
return entityliving != null && entityliving.isAlive() && this.f(entityliving.getChunkCoordinates());
|
||||
});
|
||||
|
||||
@@ -419,7 +481,7 @@
|
||||
@@ -418,7 +474,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@ -191,7 +185,7 @@
|
||||
++i;
|
||||
} else if (entityplayer.isSleeping()) {
|
||||
++j;
|
||||
@@ -437,10 +499,22 @@
|
||||
@@ -436,10 +492,22 @@
|
||||
}
|
||||
|
||||
private void clearWeather() {
|
||||
@ -216,7 +210,7 @@
|
||||
}
|
||||
|
||||
public void resetEmptyTime() {
|
||||
@@ -478,6 +552,7 @@
|
||||
@@ -477,6 +545,7 @@
|
||||
return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType()).toString();
|
||||
});
|
||||
entity.tick();
|
||||
@ -224,7 +218,7 @@
|
||||
this.getMethodProfiler().exit();
|
||||
}
|
||||
|
||||
@@ -563,6 +638,22 @@
|
||||
@@ -562,6 +631,22 @@
|
||||
BlockPosition blockposition = worldchunkmanager.a(0, 0, 256, list, random);
|
||||
ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
||||
|
||||
@ -247,7 +241,7 @@
|
||||
if (blockposition == null) {
|
||||
WorldServer.LOGGER.warn("Unable to find spawn biome");
|
||||
}
|
||||
@@ -638,6 +729,7 @@
|
||||
@@ -637,6 +722,7 @@
|
||||
ChunkProviderServer chunkproviderserver = this.getChunkProvider();
|
||||
|
||||
if (!flag1) {
|
||||
@ -255,7 +249,7 @@
|
||||
if (iprogressupdate != null) {
|
||||
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
|
||||
}
|
||||
@@ -716,8 +808,16 @@
|
||||
@@ -715,8 +801,16 @@
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
Entity entity = (Entity) objectiterator.next();
|
||||
@ -272,8 +266,8 @@
|
||||
+ // CraftBukkit end
|
||||
EnumCreatureType enumcreaturetype = entity.getEntityType().d();
|
||||
|
||||
if (enumcreaturetype != EnumCreatureType.MISC) {
|
||||
@@ -733,11 +833,24 @@
|
||||
if (enumcreaturetype != EnumCreatureType.MISC && this.getChunkProvider().a(entity)) {
|
||||
@@ -732,11 +826,24 @@
|
||||
|
||||
@Override
|
||||
public boolean addEntity(Entity entity) {
|
||||
@ -300,7 +294,7 @@
|
||||
}
|
||||
|
||||
public void addEntityTeleport(Entity entity) {
|
||||
@@ -787,13 +900,18 @@
|
||||
@@ -786,13 +893,18 @@
|
||||
this.registerEntity(entityplayer);
|
||||
}
|
||||
|
||||
@ -321,7 +315,7 @@
|
||||
IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX / 16.0D), MathHelper.floor(entity.locZ / 16.0D), ChunkStatus.FULL, entity.attachedToPlayer);
|
||||
|
||||
if (!(ichunkaccess instanceof Chunk)) {
|
||||
@@ -821,7 +939,7 @@
|
||||
@@ -820,7 +932,7 @@
|
||||
if (entity1 == null) {
|
||||
return false;
|
||||
} else {
|
||||
@ -330,7 +324,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -876,6 +994,7 @@
|
||||
@@ -875,6 +987,7 @@
|
||||
this.I.remove(((EntityInsentient) entity).getNavigation());
|
||||
}
|
||||
|
||||
@ -338,7 +332,7 @@
|
||||
}
|
||||
|
||||
private void registerEntity(Entity entity) {
|
||||
@@ -899,6 +1018,7 @@
|
||||
@@ -898,6 +1011,7 @@
|
||||
if (entity instanceof EntityInsentient) {
|
||||
this.I.add(((EntityInsentient) entity).getNavigation());
|
||||
}
|
||||
@ -346,7 +340,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -929,6 +1049,18 @@
|
||||
@@ -928,6 +1042,18 @@
|
||||
}
|
||||
|
||||
public void strikeLightning(EntityLightning entitylightning) {
|
||||
@ -365,7 +359,7 @@
|
||||
this.globalEntityList.add(entitylightning);
|
||||
this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, 512.0D, this.worldProvider.getDimensionManager(), new PacketPlayOutSpawnEntityWeather(entitylightning));
|
||||
}
|
||||
@@ -937,6 +1069,12 @@
|
||||
@@ -936,6 +1062,12 @@
|
||||
public void a(int i, BlockPosition blockposition, int j) {
|
||||
Iterator iterator = this.server.getPlayerList().getPlayers().iterator();
|
||||
|
||||
@ -378,7 +372,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -945,6 +1083,12 @@
|
||||
@@ -944,6 +1076,12 @@
|
||||
double d1 = (double) blockposition.getY() - entityplayer.locY;
|
||||
double d2 = (double) blockposition.getZ() - entityplayer.locZ;
|
||||
|
||||
@ -391,7 +385,7 @@
|
||||
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
|
||||
}
|
||||
@@ -1005,6 +1149,14 @@
|
||||
@@ -1004,6 +1142,14 @@
|
||||
|
||||
@Override
|
||||
public Explosion createExplosion(@Nullable Entity entity, DamageSource damagesource, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
|
||||
@ -406,7 +400,7 @@
|
||||
Explosion explosion = new Explosion(this, entity, d0, d1, d2, f, flag, explosion_effect);
|
||||
|
||||
if (damagesource != null) {
|
||||
@@ -1013,6 +1165,8 @@
|
||||
@@ -1012,6 +1158,8 @@
|
||||
|
||||
explosion.a();
|
||||
explosion.a(false);
|
||||
@ -415,7 +409,7 @@
|
||||
if (explosion_effect == Explosion.Effect.NONE) {
|
||||
explosion.clearBlocks();
|
||||
}
|
||||
@@ -1083,13 +1237,20 @@
|
||||
@@ -1076,13 +1224,20 @@
|
||||
}
|
||||
|
||||
public <T extends ParticleParam> int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
|
||||
@ -438,7 +432,7 @@
|
||||
++j;
|
||||
}
|
||||
}
|
||||
@@ -1172,7 +1333,13 @@
|
||||
@@ -1165,7 +1320,13 @@
|
||||
@Override
|
||||
public WorldMap a(String s) {
|
||||
return (WorldMap) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().b(() -> {
|
||||
|
4
pom.xml
4
pom.xml
@ -4,7 +4,7 @@
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.14-R0.1-SNAPSHOT</version>
|
||||
<version>1.14.1-R0.1-SNAPSHOT</version>
|
||||
<name>CraftBukkit</name>
|
||||
<url>https://www.spigotmc.org/</url>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<skipTests>true</skipTests>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<api.version>unknown</api.version>
|
||||
<minecraft.version>1.14</minecraft.version>
|
||||
<minecraft.version>1.14.1</minecraft.version>
|
||||
<minecraft_version>1_14_R1</minecraft_version>
|
||||
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
|
||||
<buildtag.suffix></buildtag.suffix>
|
||||
|
@ -918,12 +918,12 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
worlddata = new WorldData(worldSettings, name);
|
||||
} else {
|
||||
worlddata.a(name);
|
||||
worlddata.setName(name);
|
||||
worldSettings = new WorldSettings(worlddata);
|
||||
}
|
||||
|
||||
DimensionManager actualDimension = DimensionManager.a(creator.environment().getId());
|
||||
DimensionManager internalDimension = DimensionManager.a(name, new DimensionManager(dimension, actualDimension.c(), actualDimension.f, (w, manager) -> actualDimension.g.apply(w, manager), actualDimension.hasSkyLight(), actualDimension));
|
||||
DimensionManager internalDimension = DimensionManager.register(name, new DimensionManager(dimension, actualDimension.getSuffix(), actualDimension.folder, (w, manager) -> actualDimension.providerFactory.apply(w, manager), actualDimension.hasSkyLight(), actualDimension));
|
||||
WorldServer internal = (WorldServer) new WorldServer(console, console.executorService, sdm, worlddata, internalDimension, console.getMethodProfiler(), getServer().worldLoadListenerFactory.create(11), creator.environment(), generator);
|
||||
|
||||
if (!(worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) {
|
||||
|
@ -1643,7 +1643,7 @@ public class CraftWorld implements World {
|
||||
|
||||
@Override
|
||||
public int getMaxHeight() {
|
||||
return world.getHeight();
|
||||
return world.getBuildHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -177,7 +177,7 @@ public class Main {
|
||||
useConsole = false;
|
||||
}
|
||||
|
||||
if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||
Date buildDate = new SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor());
|
||||
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
|
@ -59,12 +59,12 @@ public class CraftSign extends CraftBlockEntityState<TileEntitySign> implements
|
||||
|
||||
@Override
|
||||
public DyeColor getColor() {
|
||||
return DyeColor.getByWoolData((byte) getSnapshot().f().getColorIndex());
|
||||
return DyeColor.getByWoolData((byte) getSnapshot().getColor().getColorIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColor(DyeColor color) {
|
||||
getSnapshot().a(EnumColor.fromColorIndex(color.getWoolData()));
|
||||
getSnapshot().setColor(EnumColor.fromColorIndex(color.getWoolData()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,11 +43,11 @@ public class CraftCat extends CraftTameableAnimal implements Cat {
|
||||
|
||||
@Override
|
||||
public DyeColor getCollarColor() {
|
||||
return DyeColor.getByWoolData((byte) getHandle().ei().getColorIndex());
|
||||
return DyeColor.getByWoolData((byte) getHandle().getCollarColor().getColorIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCollarColor(DyeColor color) {
|
||||
getHandle().a(EnumColor.fromColorIndex(color.getWoolData()));
|
||||
getHandle().setCollarColor(EnumColor.fromColorIndex(color.getWoolData()));
|
||||
}
|
||||
}
|
||||
|
@ -66,13 +66,13 @@ import net.minecraft.server.EntityIllagerWizard;
|
||||
import net.minecraft.server.EntityIronGolem;
|
||||
import net.minecraft.server.EntityItem;
|
||||
import net.minecraft.server.EntityItemFrame;
|
||||
import net.minecraft.server.EntityLLamaTrader;
|
||||
import net.minecraft.server.EntityLargeFireball;
|
||||
import net.minecraft.server.EntityLeash;
|
||||
import net.minecraft.server.EntityLightning;
|
||||
import net.minecraft.server.EntityLiving;
|
||||
import net.minecraft.server.EntityLlama;
|
||||
import net.minecraft.server.EntityLlamaSpit;
|
||||
import net.minecraft.server.EntityLlamaTrader;
|
||||
import net.minecraft.server.EntityMagmaCube;
|
||||
import net.minecraft.server.EntityMinecartAbstract;
|
||||
import net.minecraft.server.EntityMinecartChest;
|
||||
@ -220,7 +220,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
if (entity instanceof EntityHorseChestedAbstract){
|
||||
if (entity instanceof EntityHorseDonkey) { return new CraftDonkey(server, (EntityHorseDonkey) entity); }
|
||||
else if (entity instanceof EntityHorseMule) { return new CraftMule(server, (EntityHorseMule) entity); }
|
||||
else if (entity instanceof EntityLLamaTrader) { return new CraftTraderLlama(server, (EntityLLamaTrader) entity); }
|
||||
else if (entity instanceof EntityLlamaTrader) { return new CraftTraderLlama(server, (EntityLlamaTrader) entity); }
|
||||
else if (entity instanceof EntityLlama) { return new CraftLlama(server, (EntityLlama) entity); }
|
||||
} else if (entity instanceof EntityHorse) { return new CraftHorse(server, (EntityHorse) entity); }
|
||||
else if (entity instanceof EntityHorseSkeleton) { return new CraftSkeletonHorse(server, (EntityHorseSkeleton) entity); }
|
||||
@ -933,7 +933,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
||||
@Override
|
||||
public Pose getPose() {
|
||||
return Pose.values()[getHandle().Z().ordinal()];
|
||||
return Pose.values()[getHandle().getPose().ordinal()];
|
||||
}
|
||||
|
||||
public void storeBukkitValues(NBTTagCompound c) {
|
||||
|
@ -29,38 +29,38 @@ public class CraftFox extends CraftAnimals implements Fox {
|
||||
|
||||
@Override
|
||||
public Type getFoxType() {
|
||||
return Type.values()[getHandle().dV().ordinal()];
|
||||
return Type.values()[getHandle().getFoxType().ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFoxType(Type type) {
|
||||
Preconditions.checkArgument(type != null, "type");
|
||||
|
||||
getHandle().a(EntityFox.Type.values()[type.ordinal()]);
|
||||
getHandle().setFoxType(EntityFox.Type.values()[type.ordinal()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCrouching() {
|
||||
return getHandle().ef();
|
||||
return getHandle().isCrouching();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCrouching(boolean crouching) {
|
||||
getHandle().t(crouching);
|
||||
getHandle().setCrouching(crouching);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSitting() {
|
||||
return getHandle().dW();
|
||||
return getHandle().isSitting();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSitting(boolean sitting) {
|
||||
getHandle().r(sitting);
|
||||
getHandle().setSitting(sitting);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSleeping(boolean sleeping) {
|
||||
getHandle().x(sleeping);
|
||||
getHandle().setSleeping(sleeping);
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow {
|
||||
|
||||
@Override
|
||||
public Variant getVariant() {
|
||||
return Variant.values()[getHandle().dV().ordinal()];
|
||||
return Variant.values()[getHandle().getVariant().ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariant(Variant variant) {
|
||||
Preconditions.checkArgument(variant != null, "variant");
|
||||
|
||||
getHandle().a(EntityMushroomCow.Type.values()[variant.ordinal()]);
|
||||
getHandle().setVariant(EntityMushroomCow.Type.values()[variant.ordinal()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,19 +1,19 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityLLamaTrader;
|
||||
import net.minecraft.server.EntityLlamaTrader;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.TraderLlama;
|
||||
|
||||
public class CraftTraderLlama extends CraftLlama implements TraderLlama {
|
||||
|
||||
public CraftTraderLlama(CraftServer server, EntityLLamaTrader entity) {
|
||||
public CraftTraderLlama(CraftServer server, EntityLlamaTrader entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityLLamaTrader getHandle() {
|
||||
return (EntityLLamaTrader) super.getHandle();
|
||||
public EntityLlamaTrader getHandle() {
|
||||
return (EntityLlamaTrader) super.getHandle();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -83,16 +83,16 @@ public class CraftMerchantCustom extends CraftMerchant {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int dV() {
|
||||
public int getExperience() {
|
||||
return 0; // xp
|
||||
}
|
||||
|
||||
@Override
|
||||
public void q(int i) {
|
||||
public void r(int i) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dZ() {
|
||||
public boolean ea() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
* @return string
|
||||
*/
|
||||
public String getMappingsVersion() {
|
||||
return "30f0a3bd4ceb5c03fe41ac0cfea4ffe3";
|
||||
return "48be70f51ffe914d865f175ed3bf992d";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -142,11 +142,6 @@ public class DummyGeneratorAccess implements GeneratorAccess {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int a(BlockPosition bp, EnumDirection ed) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
|
@ -1,117 +0,0 @@
|
||||
package org.bukkit.craftbukkit.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class HashTreeSet<V> implements Set<V> {
|
||||
|
||||
private HashSet<V> hash = new HashSet<V>();
|
||||
private TreeSet<V> tree = new TreeSet<V>();
|
||||
|
||||
public HashTreeSet() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return hash.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return hash.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
return hash.contains(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<V> iterator() {
|
||||
return new Iterator<V>() {
|
||||
|
||||
private Iterator<V> it = tree.iterator();
|
||||
private V last;
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return it.hasNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public V next() {
|
||||
return last = it.next();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
if (last == null) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
it.remove();
|
||||
hash.remove(last);
|
||||
last = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
return hash.toArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] toArray(Object[] a) {
|
||||
return hash.toArray(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(V e) {
|
||||
hash.add(e);
|
||||
return tree.add(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
hash.remove(o);
|
||||
return tree.remove(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsAll(Collection c) {
|
||||
return hash.containsAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(Collection c) {
|
||||
tree.addAll(c);
|
||||
return hash.addAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retainAll(Collection c) {
|
||||
tree.retainAll(c);
|
||||
return hash.retainAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAll(Collection c) {
|
||||
tree.removeAll(c);
|
||||
return hash.removeAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
hash.clear();
|
||||
tree.clear();
|
||||
}
|
||||
|
||||
public V first() {
|
||||
return tree.first();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user