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