13
0
geforkt von Mirrors/Paper

Update to Minecraft 1.14.4

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2019-07-20 09:00:00 +10:00
Ursprung fa576e3e73
Commit a4b8e8ce68
102 geänderte Dateien mit 678 neuen und 751 gelöschten Zeilen

Datei anzeigen

@ -6,7 +6,7 @@
if (advancement == null) { if (advancement == null) {
- AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e); - AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e);
+ // CraftBukkit start + // CraftBukkit start
+ if (entry.getKey().b().equals("minecraft")) { + if (entry.getKey().getNamespace().equals("minecraft")) {
+ AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e); + AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e);
+ } + }
+ // CraftBukkit end + // CraftBukkit end

Datei anzeigen

@ -10,7 +10,7 @@
private MinecraftKey m = new MinecraftKey(""); private MinecraftKey m = new MinecraftKey("");
private BlockStateList<Block, IBlockData> n; private BlockStateList<Block, IBlockData> n;
@@ -217,7 +217,7 @@ @@ -217,7 +217,7 @@
Iterator iterator = iblockstate.d().iterator(); Iterator iterator = iblockstate.getValues().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
- T t0 = (Comparable) iterator.next(); - T t0 = (Comparable) iterator.next();

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BehaviorFarm.java --- a/net/minecraft/server/BehaviorFarm.java
+++ b/net/minecraft/server/BehaviorFarm.java +++ b/net/minecraft/server/BehaviorFarm.java
@@ -72,8 +72,8 @@ @@ -79,8 +79,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) {
@ -11,7 +11,7 @@
} }
} }
@@ -92,7 +92,11 @@ @@ -99,7 +99,11 @@
Block block1 = worldserver.getType(this.a.down()).getBlock(); Block block1 = worldserver.getType(this.a.down()).getBlock();
if (block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata) && this.c) { if (block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata) && this.c) {
@ -24,7 +24,7 @@
} }
if (iblockdata.isAir() && block1 instanceof BlockSoil && this.b) { if (iblockdata.isAir() && block1 instanceof BlockSoil && this.b) {
@@ -103,19 +107,28 @@ @@ -110,19 +114,28 @@
boolean flag = false; boolean flag = false;
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
@ -57,7 +57,7 @@
} }
if (flag) { if (flag) {
@@ -134,8 +147,8 @@ @@ -141,8 +154,8 @@
this.a = this.a(worldserver); this.a = this.a(worldserver);
if (this.a != null) { if (this.a != null) {
this.d = i + 20L; this.d = i + 20L;

Datei anzeigen

@ -1,26 +1,9 @@
--- a/net/minecraft/server/BehaviorInteractDoor.java --- a/net/minecraft/server/BehaviorInteractDoor.java
+++ b/net/minecraft/server/BehaviorInteractDoor.java +++ b/net/minecraft/server/BehaviorInteractDoor.java
@@ -23,7 +23,7 @@ @@ -46,11 +46,18 @@
Set<BlockPosition> set = this.a(worldserver, list, list1);
int j = pathentity.f() - 1;
- this.a(worldserver, list1, set, j);
+ this.a(worldserver, list1, set, j, entityliving); // CraftBukkit - add entity
}
private Set<BlockPosition> a(WorldServer worldserver, List<GlobalPos> list, List<BlockPosition> list1) {
@@ -35,13 +35,20 @@
return (Set) stream.filter(list1::contains).collect(Collectors.toSet());
}
- private void a(WorldServer worldserver, List<BlockPosition> list, Set<BlockPosition> set, int i) {
+ private void a(WorldServer worldserver, List<BlockPosition> list, Set<BlockPosition> set, int i, EntityLiving entityliving) { // CraftBukkit - add entity
set.forEach((blockposition) -> {
int j = list.indexOf(blockposition);
IBlockData iblockdata = worldserver.getType(blockposition);
Block block = iblockdata.getBlock();
if (TagsBlock.WOODEN_DOORS.isTagged(block) && block instanceof BlockDoor) { if (TagsBlock.WOODEN_DOORS.isTagged(block) && block instanceof BlockDoor) {
boolean flag = j >= i;
+ // CraftBukkit start - entities opening doors + // CraftBukkit start - entities opening doors
+ org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entityliving.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entityliving.world, blockposition)); + org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entityliving.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entityliving.world, blockposition));
+ entityliving.world.getServer().getPluginManager().callEvent(event); + entityliving.world.getServer().getPluginManager().callEvent(event);
@ -28,6 +11,12 @@
+ return; + return;
+ } + }
+ // CaftBukkit end + // CaftBukkit end
((BlockDoor) block).setDoor(worldserver, blockposition, j >= i); ((BlockDoor) block).setDoor(worldserver, blockposition, flag);
} GlobalPos globalpos = GlobalPos.create(worldserver.getWorldProvider().getDimensionManager(), blockposition);
if (!behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).isPresent() && flag) {
- behaviorcontroller.setMemory(MemoryModuleType.OPENED_DOORS, (Object) Sets.newHashSet(new GlobalPos[]{globalpos}));
+ behaviorcontroller.setMemory(MemoryModuleType.OPENED_DOORS, Sets.newHashSet(new GlobalPos[]{globalpos})); // CraftBukkit - decompile error
} else {
behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).ifPresent((set1) -> {
if (flag) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockBamboo.java --- a/net/minecraft/server/BlockBamboo.java
+++ b/net/minecraft/server/BlockBamboo.java +++ b/net/minecraft/server/BlockBamboo.java
@@ -159,14 +159,18 @@ @@ -164,14 +164,18 @@
BlockPosition blockposition1 = blockposition.down(2); BlockPosition blockposition1 = blockposition.down(2);
IBlockData iblockdata2 = world.getType(blockposition1); IBlockData iblockdata2 = world.getType(blockposition1);
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE; BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
@ -21,7 +21,7 @@
} }
} }
} else { } else {
@@ -177,7 +181,14 @@ @@ -182,7 +186,14 @@
int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && iblockdata2.getBlock() != Blocks.BAMBOO ? 0 : 1; int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && iblockdata2.getBlock() != Blocks.BAMBOO ? 0 : 1;
int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1; int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;

Datei anzeigen

@ -39,7 +39,7 @@
- this.a(world, blockposition, iblockdata, 3); - this.a(world, blockposition, iblockdata, 3);
+ // this.a(world, blockposition, iblockdata, 3); + // this.a(world, blockposition, iblockdata, 3);
+ // CraftBukkit end + // CraftBukkit end
world.a((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
} }
return true; return true;
@ -59,7 +59,7 @@
- this.a(world, blockposition, iblockdata, 0); - this.a(world, blockposition, iblockdata, 0);
+ // this.a(world, blockposition, iblockdata, 0); + // this.a(world, blockposition, iblockdata, 0);
+ // CraftBukkit end + // CraftBukkit end
world.a((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F); world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
} }
@@ -82,6 +99,10 @@ @@ -82,6 +99,10 @@
@ -76,7 +76,7 @@
@@ -96,12 +117,17 @@ @@ -96,12 +117,17 @@
} }
world.a((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F); world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
- this.a(world, blockposition, iblockdata, i - 1); - this.a(world, blockposition, iblockdata, i - 1);
+ // this.a(world, blockposition, iblockdata, i - 1); + // this.a(world, blockposition, iblockdata, i - 1);
+ // CraftBukkit end + // CraftBukkit end
@ -95,7 +95,7 @@
@@ -112,7 +138,8 @@ @@ -112,7 +138,8 @@
} }
world.a((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
- this.a(world, blockposition, iblockdata, i + 1); - this.a(world, blockposition, iblockdata, i + 1);
+ // this.a(world, blockposition, iblockdata, i + 1); + // this.a(world, blockposition, iblockdata, i + 1);
+ // CraftBukkit end + // CraftBukkit end

Datei anzeigen

@ -10,7 +10,7 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData()); world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
} else if (world.getLightLevel(blockposition.up()) >= 4) { } else {
if (world.getLightLevel(blockposition.up()) >= 9) { if (world.getLightLevel(blockposition.up()) >= 9) {
@@ -40,7 +45,7 @@ @@ -40,7 +45,7 @@
BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);

Datei anzeigen

@ -59,7 +59,7 @@
@@ -105,14 +127,14 @@ @@ -105,14 +127,14 @@
BlockPosition blockposition1 = blockposition.down(); BlockPosition blockposition1 = blockposition.down();
if (!Block.d(world.getType(blockposition1), world, blockposition1, EnumDirection.UP) || i > 3) { if (!world.getType(blockposition1).d(world, blockposition1, EnumDirection.UP) || i > 3) {
- world.a(blockposition, false); - world.a(blockposition, false);
+ fireExtinguished(world, blockposition); // CraftBukkit + fireExtinguished(world, blockposition); // CraftBukkit
} }
@ -74,7 +74,7 @@
} }
} }
@@ -120,12 +142,14 @@ @@ -120,12 +142,14 @@
boolean flag1 = world.t(blockposition); boolean flag1 = world.s(blockposition);
int k = flag1 ? -50 : 0; int k = flag1 ? -50 : 0;
- this.a(world, blockposition.east(), 300 + k, random, i); - this.a(world, blockposition.east(), 300 + k, random, i);

Datei anzeigen

@ -9,10 +9,10 @@
public class BlockMinecartDetector extends BlockMinecartTrackAbstract { public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.X; public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.X;
@@ -61,6 +63,17 @@ @@ -62,6 +64,16 @@
flag1 = true;
} }
IBlockData iblockdata1;
+ // CraftBukkit start + // CraftBukkit start
+ if (flag != flag1) { + if (flag != flag1) {
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
@ -23,7 +23,6 @@
+ flag1 = eventRedstone.getNewCurrent() > 0; + flag1 = eventRedstone.getNewCurrent() > 0;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+
if (flag1 && !flag) { if (flag1 && !flag) {
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockMinecartDetector.POWERED, true), 3); iblockdata1 = (IBlockData) iblockdata.set(BlockMinecartDetector.POWERED, true);
this.b(world, blockposition, iblockdata, true);

Datei anzeigen

@ -27,5 +27,5 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
if (i != j) { if (i != j) {
iblockdata = this.a(iblockdata, j); IBlockData iblockdata1 = this.a(iblockdata, j);
world.setTypeAndData(blockposition, iblockdata, 2);

Datei anzeigen

@ -42,7 +42,7 @@
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.a((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_CRACK, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); world.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_CRACK, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTurtleEgg.a, i + 1), 2); - world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTurtleEgg.a, i + 1), 2);
+ // world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTurtleEgg.a, i + 1), 2); // CraftBukkit - handled above + // world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTurtleEgg.a, i + 1), 2); // CraftBukkit - handled above
} else { } else {
@ -51,7 +51,7 @@
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.a((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); world.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
world.a(blockposition, false); world.a(blockposition, false);
if (!world.isClientSide) { if (!world.isClientSide) {
@@ -73,7 +102,7 @@ @@ -73,7 +102,7 @@

Datei anzeigen

@ -160,7 +160,7 @@
+ ((ProtoChunkTickList<Block>) this.o).a(this.world.getBlockTickList(), (blockposition) -> { // CraftBukkit - decompile error + ((ProtoChunkTickList<Block>) this.o).a(this.world.getBlockTickList(), (blockposition) -> { // CraftBukkit - decompile error
return this.getType(blockposition).getBlock(); return this.getType(blockposition).getBlock();
}); });
this.o = TickListEmpty.a(); this.o = TickListEmpty.b();
@@ -777,7 +853,7 @@ @@ -777,7 +853,7 @@
} }
@ -169,19 +169,19 @@
+ ((ProtoChunkTickList<FluidType>) this.p).a(this.world.getFluidTickList(), (blockposition) -> { // CraftBukkit - decompile error + ((ProtoChunkTickList<FluidType>) this.p).a(this.world.getFluidTickList(), (blockposition) -> { // CraftBukkit - decompile error
return this.getFluid(blockposition).getType(); return this.getFluid(blockposition).getType();
}); });
this.p = TickListEmpty.a(); this.p = TickListEmpty.b();
@@ -789,12 +865,12 @@ @@ -789,12 +865,12 @@
} }
public void a(WorldServer worldserver) { public void a(WorldServer worldserver) {
- if (this.o == TickListEmpty.a()) { - if (this.o == TickListEmpty.b()) {
+ if (this.o == TickListEmpty.<Block>a()) { // CraftBukkit - decompile error + if (this.o == TickListEmpty.<Block>b()) { // CraftBukkit - decompile error
this.o = new TickListChunk<>(IRegistry.BLOCK::getKey, worldserver.getBlockTickList().a(this.loc, true, false)); this.o = new TickListChunk<>(IRegistry.BLOCK::getKey, worldserver.getBlockTickList().a(this.loc, true, false));
this.setNeedsSaving(true); this.setNeedsSaving(true);
} }
- if (this.p == TickListEmpty.a()) { - if (this.p == TickListEmpty.b()) {
+ if (this.p == TickListEmpty.<FluidType>a()) { // CraftBukkit - decompile error + if (this.p == TickListEmpty.<FluidType>b()) { // CraftBukkit - decompile error
this.p = new TickListChunk<>(IRegistry.FLUID::getKey, worldserver.getFluidTickList().a(this.loc, true, false)); this.p = new TickListChunk<>(IRegistry.FLUID::getKey, worldserver.getFluidTickList().a(this.loc, true, false));
this.setNeedsSaving(true); this.setNeedsSaving(true);
} }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkMapDistance.java --- a/net/minecraft/server/ChunkMapDistance.java
+++ b/net/minecraft/server/ChunkMapDistance.java +++ b/net/minecraft/server/ChunkMapDistance.java
@@ -32,11 +32,11 @@ @@ -32,7 +32,7 @@
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
private static final int b = 33 + ChunkStatus.a(ChunkStatus.FULL) - 2; private static final int b = 33 + ChunkStatus.a(ChunkStatus.FULL) - 2;
private final Long2ObjectMap<ObjectSet<EntityPlayer>> c = new Long2ObjectOpenHashMap(); private final Long2ObjectMap<ObjectSet<EntityPlayer>> c = new Long2ObjectOpenHashMap();
@ -9,12 +9,7 @@
private final ChunkMapDistance.a e = new ChunkMapDistance.a(); private final ChunkMapDistance.a e = new ChunkMapDistance.a();
private final ChunkMapDistance.b f = new ChunkMapDistance.b(8); private final ChunkMapDistance.b f = new ChunkMapDistance.b(8);
private final ChunkMapDistance.c g = new ChunkMapDistance.c(33); private final ChunkMapDistance.c g = new ChunkMapDistance.c(33);
- private final Set<PlayerChunk> h = Sets.newHashSet(); @@ -62,7 +62,7 @@
+ private final Set<PlayerChunk> h = Sets.newHashSet(); // PAIL pendingChunkUpdates
private final PlayerChunk.c i;
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> j;
private final Mailbox<ChunkTaskQueueSorter.b> k;
@@ -61,7 +61,7 @@
while (objectiterator.hasNext()) { while (objectiterator.hasNext()) {
Entry<ObjectSortedSet<Ticket<?>>> entry = (Entry) objectiterator.next(); Entry<ObjectSortedSet<Ticket<?>>> entry = (Entry) objectiterator.next();
@ -23,15 +18,15 @@
return ticket.a(this.currentTick); return ticket.a(this.currentTick);
})) { })) {
this.e.b(entry.getLongKey(), this.a((ObjectSortedSet) entry.getValue()), false); this.e.b(entry.getLongKey(), this.a((ObjectSortedSet) entry.getValue()), false);
@@ -99,10 +99,25 @@ @@ -100,10 +100,25 @@
} }
if (!this.h.isEmpty()) { if (!this.pendingChunkUpdates.isEmpty()) {
- this.h.forEach((playerchunk) -> { - this.pendingChunkUpdates.forEach((playerchunk) -> {
+ // CraftBukkit start + // CraftBukkit start
+ // Iterate pending chunk updates with protection against concurrent modification exceptions + // Iterate pending chunk updates with protection against concurrent modification exceptions
+ java.util.Iterator<PlayerChunk> iter = this.h.iterator(); + java.util.Iterator<PlayerChunk> iter = this.pendingChunkUpdates.iterator();
+ int expectedSize = this.h.size(); + int expectedSize = this.pendingChunkUpdates.size();
+ do { + do {
+ PlayerChunk playerchunk = iter.next(); + PlayerChunk playerchunk = iter.next();
+ iter.remove(); + iter.remove();
@ -39,12 +34,12 @@
+ +
playerchunk.a(playerchunkmap); playerchunk.a(playerchunkmap);
- }); - });
- this.h.clear(); - this.pendingChunkUpdates.clear();
+ +
+ // Reset iterator if set was modified using add() + // Reset iterator if set was modified using add()
+ if (this.h.size() != expectedSize) { + if (this.pendingChunkUpdates.size() != expectedSize) {
+ expectedSize = this.h.size(); + expectedSize = this.pendingChunkUpdates.size();
+ iter = this.h.iterator(); + iter = this.pendingChunkUpdates.iterator();
+ } + }
+ } while (iter.hasNext()); + } while (iter.hasNext());
+ // CraftBukkit end + // CraftBukkit end
@ -52,7 +47,7 @@
return true; return true;
} else { } else {
if (!this.l.isEmpty()) { if (!this.l.isEmpty()) {
@@ -124,7 +139,7 @@ @@ -125,7 +140,7 @@
completablefuture.thenAccept((either) -> { completablefuture.thenAccept((either) -> {
this.m.execute(() -> { this.m.execute(() -> {
@ -61,16 +56,16 @@
}, j, false)); }, j, false));
}); });
}); });
@@ -138,7 +153,7 @@ @@ -139,7 +154,7 @@
} }
} }
- private void a(long i, Ticket<?> ticket) { - private void addTicket(long i, Ticket<?> ticket) {
+ private boolean a(long i, Ticket<?> ticket) { // CraftBukkit - void -> boolean // PAIL addTicket + private boolean addTicket(long i, Ticket<?> ticket) { // CraftBukkit - void -> boolean
ObjectSortedSet<Ticket<?>> objectsortedset = this.e(i); ObjectSortedSet<Ticket<?>> objectsortedset = this.e(i);
ObjectBidirectionalIterator<Ticket<?>> objectbidirectionaliterator = objectsortedset.iterator(); ObjectBidirectionalIterator<Ticket<?>> objectbidirectionaliterator = objectsortedset.iterator();
int j; int j;
@@ -149,21 +164,24 @@ @@ -150,21 +165,24 @@
j = PlayerChunkMap.GOLDEN_TICKET + 1; j = PlayerChunkMap.GOLDEN_TICKET + 1;
} }
@ -87,8 +82,8 @@
+ return ret; // CraftBukkit + return ret; // CraftBukkit
} }
- private void b(long i, Ticket<?> ticket) { - private void removeTicket(long i, Ticket<?> ticket) {
+ private boolean b(long i, Ticket<?> ticket) { // CraftBukkit - void -> boolean // PAIL removeTicket + private boolean removeTicket(long i, Ticket<?> ticket) { // CraftBukkit - void -> boolean
ObjectSortedSet<Ticket<?>> objectsortedset = this.e(i); ObjectSortedSet<Ticket<?>> objectsortedset = this.e(i);
+ boolean removed = false; // CraftBukkit + boolean removed = false; // CraftBukkit
@ -98,7 +93,7 @@
} }
if (objectsortedset.isEmpty()) { if (objectsortedset.isEmpty()) {
@@ -171,16 +189,27 @@ @@ -172,16 +190,29 @@
} }
this.e.b(i, this.a(objectsortedset), false); this.e.b(i, this.a(objectsortedset), false);
@ -106,12 +101,13 @@
} }
public <T> void a(TicketType<T> tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) { public <T> void a(TicketType<T> tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) {
- this.a(chunkcoordintpair.pair(), new Ticket<>(tickettype, i, t0, this.currentTick)); - this.addTicket(chunkcoordintpair.pair(), new Ticket<>(tickettype, i, t0, this.currentTick));
+ // CraftBukkit start + // CraftBukkit start
+ this.addTicketAtLevel(tickettype, chunkcoordintpair, i, t0); + this.addTicketAtLevel(tickettype, chunkcoordintpair, i, t0);
+ } + }
+ public <T> boolean addTicketAtLevel(TicketType<T> ticketType, ChunkCoordIntPair chunkPos, int level, T identifier) { +
+ return this.a(chunkPos.pair(), new Ticket<>(ticketType, level, identifier, this.currentTick)); + public <T> boolean addTicketAtLevel(TicketType<T> ticketType, ChunkCoordIntPair chunkcoordintpair, int level, T identifier) {
+ return this.addTicket(chunkcoordintpair.pair(), new Ticket<>(ticketType, level, identifier, this.currentTick));
+ // CraftBukkit end + // CraftBukkit end
} }
@ -120,17 +116,18 @@
+ // CraftBukkit start + // CraftBukkit start
+ this.removeTicketAtLevel(tickettype, chunkcoordintpair, i, t0); + this.removeTicketAtLevel(tickettype, chunkcoordintpair, i, t0);
+ } + }
+ public <T> boolean removeTicketAtLevel(TicketType<T> ticketType, ChunkCoordIntPair chunkPos, int level, T identifier) {
+ Ticket<T> ticket = new Ticket<>(ticketType, level, identifier, this.currentTick);
- this.b(chunkcoordintpair.pair(), ticket); - this.removeTicket(chunkcoordintpair.pair(), ticket);
+ return this.b(chunkPos.pair(), ticket); + public <T> boolean removeTicketAtLevel(TicketType<T> ticketType, ChunkCoordIntPair chunkcoordintpair, int level, T identifier) {
+ Ticket<T> ticket = new Ticket<>(ticketType, level, identifier, this.currentTick);
+
+ return this.removeTicket(chunkcoordintpair.pair(), ticket);
+ // CraftBukkit end + // CraftBukkit end
} }
public <T> void addTicket(TicketType<T> tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) { public <T> void addTicket(TicketType<T> tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) {
@@ -247,6 +276,21 @@ @@ -265,6 +296,21 @@
return this.f.a.containsKey(i); return this.i.a();
} }
+ // CraftBukkit start + // CraftBukkit start
@ -151,21 +148,28 @@
class a extends ChunkMap { class a extends ChunkMap {
public a() { public a() {
@@ -333,7 +377,7 @@ @@ -351,13 +397,13 @@
Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, ChunkMapDistance.b, new ChunkCoordIntPair(i), ChunkMapDistance.this.currentTick); Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, ChunkMapDistance.b, new ChunkCoordIntPair(i), ChunkMapDistance.this.currentTick);
if (flag1) { if (flag1) {
- ChunkMapDistance.this.j.a((Object) ChunkTaskQueueSorter.a(() -> { - ChunkMapDistance.this.j.a((Object) ChunkTaskQueueSorter.a(() -> {
+ ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> { // Craftbukkit - decompile error + ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> { // Craftbukkit - decompile error
ChunkMapDistance.this.m.execute(() -> { ChunkMapDistance.this.m.execute(() -> {
ChunkMapDistance.this.a(i, ticket); if (this.c(this.c(i))) {
ChunkMapDistance.this.addTicket(i, ticket);
ChunkMapDistance.this.l.add(i); ChunkMapDistance.this.l.add(i);
@@ -342,7 +386,7 @@ } else {
- ChunkMapDistance.this.k.a((Object) ChunkTaskQueueSorter.a(() -> {
+ ChunkMapDistance.this.k.a(ChunkTaskQueueSorter.a(() -> { // Craftbukkit - decompile error
}, i, false));
}
@@ -366,7 +412,7 @@
return j; return j;
})); }));
} else { } else {
- ChunkMapDistance.this.k.a((Object) ChunkTaskQueueSorter.a(() -> { - ChunkMapDistance.this.k.a((Object) ChunkTaskQueueSorter.a(() -> {
+ ChunkMapDistance.this.k.a(ChunkTaskQueueSorter.a(() -> { // Craftbukkit - decompile error + ChunkMapDistance.this.k.a(ChunkTaskQueueSorter.a(() -> { // Craftbukkit - decompile error
ChunkMapDistance.this.m.execute(() -> { ChunkMapDistance.this.m.execute(() -> {
ChunkMapDistance.this.b(i, ticket); ChunkMapDistance.this.removeTicket(i, ticket);
}); });

Datei anzeigen

@ -9,7 +9,7 @@
for (int i = -2; i <= 2; ++i) { for (int i = -2; i <= 2; ++i) {
for (int j = -2; j <= 2; ++j) { for (int j = -2; j <= 2; ++j) {
float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F); float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F);
@@ -81,6 +81,11 @@ @@ -82,6 +82,11 @@
f4 = 1.0F + f4 * 2.0F; f4 = 1.0F + f4 * 2.0F;
f5 = 1.0F + f5 * 4.0F; f5 = 1.0F + f5 * 4.0F;
} }

Datei anzeigen

@ -1,6 +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
@@ -79,7 +79,7 @@ @@ -92,7 +92,7 @@
for (int l = 0; l < 4; ++l) { for (int l = 0; l < 4; ++l) {
if (k == this.cachePos[l] && chunkstatus == this.cacheStatus[l]) { if (k == this.cachePos[l] && chunkstatus == this.cacheStatus[l]) {
ichunkaccess = this.cacheChunk[l]; ichunkaccess = this.cacheChunk[l];
@ -9,7 +9,22 @@
return ichunkaccess; return ichunkaccess;
} }
} }
@@ -123,7 +123,15 @@ @@ -136,12 +136,12 @@
if (playerchunk == null) {
return null;
} else {
- Either<IChunkAccess, PlayerChunk.Failure> either = (Either) playerchunk.b(ChunkStatus.FULL).getNow((Object) null);
+ Either<IChunkAccess, PlayerChunk.Failure> either = (Either) playerchunk.b(ChunkStatus.FULL).getNow(null); // Craftbukkit - decompile error
if (either == null) {
return null;
} else {
- IChunkAccess ichunkaccess1 = (IChunkAccess) either.left().orElse((Object) null);
+ IChunkAccess ichunkaccess1 = (IChunkAccess) either.left().orElse(null); // Craftbukkit - decompile error
if (ichunkaccess1 != null) {
this.a(k, ichunkaccess1, ChunkStatus.FULL);
@@ -168,7 +168,15 @@
int l = 33 + ChunkStatus.a(chunkstatus); int l = 33 + ChunkStatus.a(chunkstatus);
PlayerChunk playerchunk = this.getChunk(k); PlayerChunk playerchunk = this.getChunk(k);
@ -26,7 +41,7 @@
this.chunkMapDistance.a(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair); this.chunkMapDistance.a(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
if (this.a(playerchunk, l)) { if (this.a(playerchunk, l)) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@@ -142,7 +150,7 @@ @@ -187,7 +195,7 @@
} }
private boolean a(@Nullable PlayerChunk playerchunk, int i) { private boolean a(@Nullable PlayerChunk playerchunk, int i) {
@ -35,7 +50,7 @@
} }
public boolean isLoaded(int i, int j) { public boolean isLoaded(int i, int j) {
@@ -249,6 +257,18 @@ @@ -294,6 +302,18 @@
this.playerChunkMap.close(); this.playerChunkMap.close();
} }
@ -54,7 +69,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();
@@ -268,13 +288,13 @@ @@ -313,13 +333,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;
@ -70,7 +85,7 @@
this.world.getMethodProfiler().enter("naturalSpawnCount"); this.world.getMethodProfiler().enter("naturalSpawnCount");
int l = this.chunkMapDistance.b(); int l = this.chunkMapDistance.b();
@@ -303,8 +323,30 @@ @@ -348,8 +368,30 @@
for (int j1 = 0; j1 < i1; ++j1) { for (int j1 = 0; j1 < i1; ++j1) {
EnumCreatureType enumcreaturetype = aenumcreaturetype1[j1]; EnumCreatureType enumcreaturetype = aenumcreaturetype1[j1];
@ -102,7 +117,7 @@
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);
@@ -447,12 +489,18 @@ @@ -497,12 +539,18 @@
@Override @Override
protected boolean executeNext() { protected boolean executeNext() {

Datei anzeigen

@ -20,7 +20,7 @@
public CommandBlockListenerAbstract() {} public CommandBlockListenerAbstract() {}
@@ -102,14 +107,7 @@ @@ -102,14 +107,7 @@
if (minecraftserver != null && minecraftserver.E() && minecraftserver.getEnableCommandBlock() && !UtilColor.b(this.command)) { if (minecraftserver != null && minecraftserver.F() && minecraftserver.getEnableCommandBlock() && !UtilColor.b(this.command)) {
try { try {
this.lastOutput = null; this.lastOutput = null;
- CommandListenerWrapper commandlistenerwrapper = this.getWrapper().a((commandcontext, flag, i) -> { - CommandListenerWrapper commandlistenerwrapper = this.getWrapper().a((commandcontext, flag, i) -> {

Datei anzeigen

@ -38,7 +38,7 @@
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
- this.resultInventory.setItem(0, ItemStack.a); - this.resultInventory.setItem(0, ItemStack.a);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit
this.levelCost.a(0); this.levelCost.set(0);
} else { } else {
ItemStack itemstack1 = itemstack.cloneItemStack(); ItemStack itemstack1 = itemstack.cloneItemStack();
@@ -141,7 +152,7 @@ @@ -141,7 +152,7 @@
@ -47,7 +47,7 @@
if (k <= 0) { if (k <= 0) {
- this.resultInventory.setItem(0, ItemStack.a); - this.resultInventory.setItem(0, ItemStack.a);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit
this.levelCost.a(0); this.levelCost.set(0);
return; return;
} }
@@ -156,7 +167,7 @@ @@ -156,7 +167,7 @@
@ -56,7 +56,7 @@
if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.e())) { if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.e())) {
- this.resultInventory.setItem(0, ItemStack.a); - this.resultInventory.setItem(0, ItemStack.a);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit
this.levelCost.a(0); this.levelCost.set(0);
return; return;
} }
@@ -246,7 +257,7 @@ @@ -246,7 +257,7 @@
@ -65,21 +65,21 @@
if (flag2 && !flag1) { if (flag2 && !flag1) {
- this.resultInventory.setItem(0, ItemStack.a); - this.resultInventory.setItem(0, ItemStack.a);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit
this.levelCost.a(0); this.levelCost.set(0);
return; return;
} }
@@ -270,11 +281,11 @@ @@ -270,11 +281,11 @@
itemstack1 = ItemStack.a; itemstack1 = ItemStack.a;
} }
- if (b1 == i && b1 > 0 && this.levelCost.b() >= 40) { - if (b1 == i && b1 > 0 && this.levelCost.get() >= 40) {
- this.levelCost.a(39); - this.levelCost.set(39);
+ if (b1 == i && b1 > 0 && this.levelCost.b() >= maximumRepairCost) { // CraftBukkit + if (b1 == i && b1 > 0 && this.levelCost.get() >= maximumRepairCost) { // CraftBukkit
+ this.levelCost.a(maximumRepairCost - 1); // CraftBukkit + this.levelCost.set(maximumRepairCost - 1); // CraftBukkit
} }
- if (this.levelCost.b() >= 40 && !this.player.abilities.canInstantlyBuild) { - if (this.levelCost.get() >= 40 && !this.player.abilities.canInstantlyBuild) {
+ if (this.levelCost.b() >= maximumRepairCost && !this.player.abilities.canInstantlyBuild) { // CraftBukkit + if (this.levelCost.get() >= maximumRepairCost && !this.player.abilities.canInstantlyBuild) { // CraftBukkit
itemstack1 = ItemStack.a; itemstack1 = ItemStack.a;
} }

Datei anzeigen

@ -42,4 +42,4 @@
+ if (!this.merchant.getWorld().isClientSide && this.merchant instanceof Entity) { // CraftBukkit - SPIGOT-5035 + if (!this.merchant.getWorld().isClientSide && this.merchant instanceof Entity) { // CraftBukkit - SPIGOT-5035
Entity entity = (Entity) this.merchant; Entity entity = (Entity) this.merchant;
this.merchant.getWorld().a(entity.locX, entity.locY, entity.locZ, this.merchant.ec(), SoundCategory.NEUTRAL, 1.0F, 1.0F, false); this.merchant.getWorld().a(entity.locX, entity.locY, entity.locZ, this.merchant.eb(), SoundCategory.NEUTRAL, 1.0F, 1.0F, false);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CrashReport.java --- a/net/minecraft/server/CrashReport.java
+++ b/net/minecraft/server/CrashReport.java +++ b/net/minecraft/server/CrashReport.java
@@ -64,6 +64,7 @@ @@ -68,6 +68,7 @@
return String.format("%d total; %s", list.size(), list.stream().collect(Collectors.joining(" "))); return String.format("%d total; %s", list.size(), list.stream().collect(Collectors.joining(" ")));
}); });

Datei anzeigen

@ -160,7 +160,7 @@
} }
} }
@@ -529,14 +599,45 @@ @@ -534,14 +604,45 @@
@Override @Override
public String getPlugins() { public String getPlugins() {
@ -195,20 +195,20 @@
public String executeRemoteCommand(String s) { public String executeRemoteCommand(String s) {
this.remoteControlCommandListener.clearMessages(); this.remoteControlCommandListener.clearMessages();
this.executeSync(() -> { this.executeSync(() -> {
- this.getCommandDispatcher().a(this.remoteControlCommandListener.f(), s); - this.getCommandDispatcher().a(this.remoteControlCommandListener.getWrapper(), s);
+ // CraftBukkit start - fire RemoteServerCommandEvent + // CraftBukkit start - fire RemoteServerCommandEvent
+ RemoteServerCommandEvent event = new RemoteServerCommandEvent(remoteConsole, s); + RemoteServerCommandEvent event = new RemoteServerCommandEvent(remoteConsole, s);
+ server.getPluginManager().callEvent(event); + server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ return; + return;
+ } + }
+ ServerCommand serverCommand = new ServerCommand(event.getCommand(), remoteControlCommandListener.f()); + ServerCommand serverCommand = new ServerCommand(event.getCommand(), remoteControlCommandListener.getWrapper());
+ server.dispatchServerCommand(remoteConsole, serverCommand); + server.dispatchServerCommand(remoteConsole, serverCommand);
+ // CraftBukkit end + // CraftBukkit end
}); });
return this.remoteControlCommandListener.getMessages(); return this.remoteControlCommandListener.getMessages();
} }
@@ -557,4 +658,16 @@ @@ -562,4 +663,16 @@
public boolean b(GameProfile gameprofile) { public boolean b(GameProfile gameprofile) {
return false; return false;
} }

Datei anzeigen

@ -12,7 +12,7 @@
public final boolean onlineMode = this.getBoolean("online-mode", true); public final boolean onlineMode = this.getBoolean("online-mode", true);
public final boolean preventProxyConnections = this.getBoolean("prevent-proxy-connections", false); public final boolean preventProxyConnections = this.getBoolean("prevent-proxy-connections", false);
public final String serverIp = this.getString("server-ip", ""); public final String serverIp = this.getString("server-ip", "");
@@ -51,8 +53,10 @@ @@ -52,8 +54,10 @@
public final PropertyManager<DedicatedServerProperties>.EditableProperty<Integer> playerIdleTimeout; public final PropertyManager<DedicatedServerProperties>.EditableProperty<Integer> playerIdleTimeout;
public final PropertyManager<DedicatedServerProperties>.EditableProperty<Boolean> whiteList; public final PropertyManager<DedicatedServerProperties>.EditableProperty<Boolean> whiteList;
@ -25,7 +25,7 @@
this.difficulty = (EnumDifficulty) this.a("difficulty", a(EnumDifficulty::getById, EnumDifficulty::a), EnumDifficulty::c, EnumDifficulty.EASY); this.difficulty = (EnumDifficulty) this.a("difficulty", a(EnumDifficulty::getById, EnumDifficulty::a), EnumDifficulty::c, EnumDifficulty.EASY);
this.gamemode = (EnumGamemode) this.a("gamemode", a(EnumGamemode::getById, EnumGamemode::a), EnumGamemode::b, EnumGamemode.SURVIVAL); this.gamemode = (EnumGamemode) this.a("gamemode", a(EnumGamemode::getById, EnumGamemode::a), EnumGamemode::b, EnumGamemode.SURVIVAL);
this.levelName = this.getString("level-name", "world"); this.levelName = this.getString("level-name", "world");
@@ -96,12 +100,14 @@ @@ -98,12 +102,14 @@
this.whiteList = this.b("white-list", false); this.whiteList = this.b("white-list", false);
} }

Datei anzeigen

@ -12,7 +12,7 @@
public DispenseBehaviorProjectile() {} public DispenseBehaviorProjectile() {}
@@ -11,9 +16,38 @@ @@ -11,9 +16,38 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
IProjectile iprojectile = this.a(world, iposition, itemstack); IProjectile iprojectile = this.a(world, iposition, itemstack);
- iprojectile.shoot((double) enumdirection.getAdjacentX(), (double) ((float) enumdirection.getAdjacentY() + 0.1F), (double) enumdirection.getAdjacentZ(), this.getPower(), this.a()); - iprojectile.shoot((double) enumdirection.getAdjacentX(), (double) ((float) enumdirection.getAdjacentY() + 0.1F), (double) enumdirection.getAdjacentZ(), this.getPower(), this.a());

Datei anzeigen

@ -65,7 +65,7 @@
entityareaeffectcloud.setRadiusOnUse(-0.5F); entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10); entityareaeffectcloud.setWaitTime(10);
@@ -219,7 +243,7 @@ @@ -219,7 +243,7 @@
entityareaeffectcloud.a(new MobEffect(mobeffect)); entityareaeffectcloud.addEffect(new MobEffect(mobeffect));
} }
- this.world.addEntity(entityareaeffectcloud); - this.world.addEntity(entityareaeffectcloud);

Datei anzeigen

@ -20,7 +20,7 @@
if (entityliving == null) { if (entityliving == null) {
@@ -65,6 +75,7 @@ @@ -65,6 +75,7 @@
attributeinstance.b(EntityEnderman.c); attributeinstance.addModifier(EntityEnderman.c);
} }
} }
+ return true; + return true;

Datei anzeigen

@ -18,7 +18,7 @@
this.world.a(blockposition, false); this.world.a(blockposition, false);
} else if (!this.world.isClientSide) { } else if (!this.world.isClientSide) {
this.die(); this.die();
@@ -125,6 +127,11 @@ @@ -124,6 +126,11 @@
this.block = (IBlockData) this.block.set(BlockProperties.C, true); this.block = (IBlockData) this.block.set(BlockProperties.C, true);
} }
@ -30,7 +30,7 @@
if (this.world.setTypeAndData(blockposition, this.block, 3)) { if (this.world.setTypeAndData(blockposition, this.block, 3)) {
if (block instanceof BlockFalling) { if (block instanceof BlockFalling) {
((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata); ((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata);
@@ -179,7 +186,9 @@ @@ -180,7 +187,9 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/EntityFox.java --- a/net/minecraft/server/EntityFox.java
+++ b/net/minecraft/server/EntityFox.java +++ b/net/minecraft/server/EntityFox.java
@@ -267,8 +267,8 @@ @@ -267,8 +267,8 @@
private List<UUID> el() { private List<UUID> ek() {
List<UUID> list = Lists.newArrayList(); List<UUID> list = Lists.newArrayList();
- list.add(((Optional) this.datawatcher.get(EntityFox.bB)).orElse((Object) null)); - list.add(((Optional) this.datawatcher.get(EntityFox.bB)).orElse((Object) null));

Datei anzeigen

@ -51,7 +51,7 @@
+ this.heal(1.0F, RegainReason.REGEN); // CraftBukkit + this.heal(1.0F, RegainReason.REGEN); // CraftBukkit
} }
if (this.eu()) { if (this.et()) {
@@ -716,6 +718,7 @@ @@ -716,6 +718,7 @@
if (this.getOwnerUUID() != null) { if (this.getOwnerUUID() != null) {
nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString()); nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString());
@ -89,5 +89,5 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.canSlide = true; this.canSlide = true;
this.eC(); this.eB();
} }

Datei anzeigen

@ -26,9 +26,9 @@
private static final DataWatcherObject<Float> c = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c); private static final DataWatcherObject<Float> c = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c);
private static final DataWatcherObject<Integer> d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b);
protected static final DataWatcherObject<Byte> bt = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); protected static final DataWatcherObject<Byte> bt = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
@@ -26,10 +40,10 @@ @@ -27,10 +41,10 @@
protected static final DataWatcherObject<NBTTagCompound> bv = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
protected static final DataWatcherObject<NBTTagCompound> bw = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); protected static final DataWatcherObject<NBTTagCompound> bw = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
private long e;
public final PlayerInventory inventory = new PlayerInventory(this); public final PlayerInventory inventory = new PlayerInventory(this);
- protected InventoryEnderChest enderChest = new InventoryEnderChest(); - protected InventoryEnderChest enderChest = new InventoryEnderChest();
+ protected InventoryEnderChest enderChest = new InventoryEnderChest(this); // CraftBukkit - add "this" to constructor + protected InventoryEnderChest enderChest = new InventoryEnderChest(this); // CraftBukkit - add "this" to constructor
@ -39,7 +39,7 @@
protected int bC; protected int bC;
public float bD; public float bD;
public float bE; public float bE;
@@ -57,6 +71,17 @@ @@ -58,6 +72,17 @@
@Nullable @Nullable
public EntityFishingHook hookedFish; public EntityFishingHook hookedFish;
@ -56,8 +56,8 @@
+ +
public EntityHuman(World world, GameProfile gameprofile) { public EntityHuman(World world, GameProfile gameprofile) {
super(EntityTypes.PLAYER, world); super(EntityTypes.PLAYER, world);
this.bX = ItemStack.a; this.bY = ItemStack.a;
@@ -179,7 +204,7 @@ @@ -194,7 +219,7 @@
ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD); ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);
if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a(TagsFluid.WATER)) { if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a(TagsFluid.WATER)) {
@ -66,7 +66,7 @@
} }
} }
@@ -352,7 +377,8 @@ @@ -367,7 +392,8 @@
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean(GameRules.NATURAL_REGENERATION)) { if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean(GameRules.NATURAL_REGENERATION)) {
if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) { if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) {
@ -76,7 +76,7 @@
} }
if (this.foodData.c() && this.ticksLived % 10 == 0) { if (this.foodData.c() && this.ticksLived % 10 == 0) {
@@ -497,6 +523,7 @@ @@ -512,6 +538,7 @@
@Nullable @Nullable
public EntityItem n(boolean flag) { public EntityItem n(boolean flag) {
@ -84,7 +84,7 @@
return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && !this.inventory.getItemInHand().isEmpty() ? this.inventory.getItemInHand().getCount() : 1), false, true); return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && !this.inventory.getItemInHand().isEmpty() ? this.inventory.getItemInHand().getCount() : 1), false, true);
} }
@@ -537,6 +564,30 @@ @@ -552,6 +579,30 @@
entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6); entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
} }
@ -115,7 +115,7 @@
return entityitem; return entityitem;
} }
} }
@@ -611,6 +662,14 @@ @@ -626,6 +677,14 @@
} }
this.setScore(nbttagcompound.getInt("Score")); this.setScore(nbttagcompound.getInt("Score"));
@ -128,9 +128,9 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) { if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
this.f = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ")); this.g = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
this.g = nbttagcompound.getBoolean("SpawnForced"); this.bU = nbttagcompound.getBoolean("SpawnForced");
@@ -661,6 +720,7 @@ @@ -676,6 +735,7 @@
if (!this.getShoulderEntityRight().isEmpty()) { if (!this.getShoulderEntityRight().isEmpty()) {
nbttagcompound.set("ShoulderEntityRight", this.getShoulderEntityRight()); nbttagcompound.set("ShoulderEntityRight", this.getShoulderEntityRight());
} }
@ -138,7 +138,7 @@
} }
@@ -675,10 +735,10 @@ @@ -690,10 +750,10 @@
if (this.getHealth() <= 0.0F) { if (this.getHealth() <= 0.0F) {
return false; return false;
} else { } else {
@ -151,7 +151,7 @@
} }
if (this.world.getDifficulty() == EnumDifficulty.EASY) { if (this.world.getDifficulty() == EnumDifficulty.EASY) {
@@ -690,7 +750,13 @@ @@ -705,7 +765,13 @@
} }
} }
@ -166,7 +166,7 @@
} }
} }
} }
@@ -705,10 +771,29 @@ @@ -720,10 +786,29 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
@ -199,7 +199,7 @@
} }
@Override @Override
@@ -739,8 +824,13 @@ @@ -754,8 +839,13 @@
} }
@ -214,7 +214,7 @@
if (!this.isInvulnerable(damagesource)) { if (!this.isInvulnerable(damagesource)) {
f = this.applyArmorModifier(damagesource, f); f = this.applyArmorModifier(damagesource, f);
f = this.applyMagicModifier(damagesource, f); f = this.applyMagicModifier(damagesource, f);
@@ -766,6 +856,7 @@ @@ -781,6 +871,7 @@
} }
} }
@ -222,7 +222,7 @@
} }
public void openSign(TileEntitySign tileentitysign) {} public void openSign(TileEntitySign tileentitysign) {}
@@ -896,8 +987,15 @@ @@ -911,8 +1002,15 @@
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth(); f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isBurning()) { if (j > 0 && !entity.isBurning()) {
@ -240,7 +240,7 @@
} }
} }
@@ -925,8 +1023,11 @@ @@ -940,8 +1038,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next(); EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h((Entity) entityliving) < 9.0D) { if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h((Entity) entityliving) < 9.0D) {
@ -253,7 +253,7 @@
} }
} }
@@ -935,9 +1036,26 @@ @@ -950,9 +1051,26 @@
} }
if (entity instanceof EntityPlayer && entity.velocityChanged) { if (entity instanceof EntityPlayer && entity.velocityChanged) {
@ -280,7 +280,7 @@
} }
if (flag2) { if (flag2) {
@@ -982,7 +1100,14 @@ @@ -997,7 +1115,14 @@
this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F)); this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
if (j > 0) { if (j > 0) {
@ -296,7 +296,7 @@
} }
if (this.world instanceof WorldServer && f5 > 2.0F) { if (this.world instanceof WorldServer && f5 > 2.0F) {
@@ -998,6 +1123,11 @@ @@ -1013,6 +1138,11 @@
if (flag4) { if (flag4) {
entity.extinguish(); entity.extinguish();
} }
@ -308,8 +308,8 @@
} }
} }
@@ -1057,15 +1187,15 @@ @@ -1072,15 +1202,15 @@
return this.bV; return this.bW;
} }
- public Either<EntityHuman.EnumBedResult, Unit> sleep(BlockPosition blockposition) { - public Either<EntityHuman.EnumBedResult, Unit> sleep(BlockPosition blockposition) {
@ -328,7 +328,7 @@
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE); return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE);
} }
@@ -1093,6 +1223,34 @@ @@ -1108,6 +1238,34 @@
} }
} }
} }
@ -363,7 +363,7 @@
this.e(blockposition); this.e(blockposition);
this.sleepTicks = 0; this.sleepTicks = 0;
@@ -1134,6 +1292,24 @@ @@ -1148,6 +1306,24 @@
((WorldServer) this.world).everyoneSleeping(); ((WorldServer) this.world).everyoneSleeping();
} }
@ -388,19 +388,19 @@
this.sleepTicks = flag ? 0 : 100; this.sleepTicks = flag ? 0 : 100;
if (flag2) { if (flag2) {
optional.ifPresent((blockposition) -> { optional.ifPresent((blockposition) -> {
@@ -1187,9 +1363,11 @@ @@ -1201,9 +1377,11 @@
if (blockposition != null) { if (blockposition != null) {
this.f = blockposition; this.g = blockposition;
this.g = flag; this.bU = flag;
+ this.spawnWorld = this.world.worldData.getName(); // CraftBukkit + this.spawnWorld = this.world.worldData.getName(); // CraftBukkit
} else { } else {
this.f = null; this.g = null;
this.g = false; this.bU = false;
+ this.spawnWorld = ""; // CraftBukkit + this.spawnWorld = ""; // CraftBukkit
} }
} }
@@ -1261,7 +1439,11 @@ @@ -1275,7 +1453,11 @@
this.setMot(vec3d2.x, d3 * 0.6D, vec3d2.z); this.setMot(vec3d2.x, d3 * 0.6D, vec3d2.z);
this.aO = f; this.aO = f;
this.fallDistance = 0.0F; this.fallDistance = 0.0F;
@ -413,10 +413,10 @@
} else { } else {
super.e(vec3d); super.e(vec3d);
} }
@@ -1580,24 +1762,29 @@ @@ -1597,26 +1779,31 @@
}
protected void releaseShoulderEntities() { protected void releaseShoulderEntities() {
if (this.e + 20L < this.world.getTime()) {
- this.spawnEntityFromShoulder(this.getShoulderEntityLeft()); - this.spawnEntityFromShoulder(this.getShoulderEntityLeft());
- this.setShoulderEntityLeft(new NBTTagCompound()); - this.setShoulderEntityLeft(new NBTTagCompound());
- this.spawnEntityFromShoulder(this.getShoulderEntityRight()); - this.spawnEntityFromShoulder(this.getShoulderEntityRight());
@ -431,8 +431,10 @@
+ // CraftBukkit end + // CraftBukkit end
} }
- private void spawnEntityFromShoulder(@Nullable NBTTagCompound nbttagcompound) { }
+ private boolean spawnEntityFromShoulder(@Nullable NBTTagCompound nbttagcompound) { // CraftBukkit void->boolean
- private void spawnEntityFromShoulder(NBTTagCompound nbttagcompound) {
+ private boolean spawnEntityFromShoulder(NBTTagCompound nbttagcompound) { // CraftBukkit void->boolean
if (!this.world.isClientSide && !nbttagcompound.isEmpty()) { if (!this.world.isClientSide && !nbttagcompound.isEmpty()) {
- EntityTypes.a(nbttagcompound, this.world).ifPresent((entity) -> { - EntityTypes.a(nbttagcompound, this.world).ifPresent((entity) -> {
+ return EntityTypes.a(nbttagcompound, this.world).map((entity) -> { // CraftBukkit + return EntityTypes.a(nbttagcompound, this.world).map((entity) -> { // CraftBukkit

Datei anzeigen

@ -25,9 +25,9 @@
public void tick() { public void tick() {
super.tick(); super.tick();
if (this.lifeTicks == 2) { if (this.lifeTicks == 2) {
- this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); - this.world.playSound((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F);
+ // CraftBukkit start - Use relative location for far away sounds + // CraftBukkit start - Use relative location for far away sounds
+ // this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); + // this.world.playSound((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F);
+ float pitch = 0.8F + this.random.nextFloat() * 0.2F; + float pitch = 0.8F + this.random.nextFloat() * 0.2F;
+ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; + int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;
+ for (EntityPlayer player : (List<EntityPlayer>) (List) this.world.getPlayers()) { + for (EntityPlayer player : (List<EntityPlayer>) (List) this.world.getPlayers()) {
@ -44,7 +44,7 @@
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F); this.world.playSound((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F);
} }
@@ -59,7 +80,7 @@ @@ -59,7 +80,7 @@

Datei anzeigen

@ -797,7 +797,7 @@
+ +
+ this.a(this.getRaisedHand(), itemstack); + this.a(this.getRaisedHand(), itemstack);
+ // CraftBukkit end + // CraftBukkit end
this.dq(); this.dp();
} }
@@ -2495,10 +2908,18 @@ @@ -2495,10 +2908,18 @@
@ -825,7 +825,7 @@
@@ -2585,7 +3006,7 @@ @@ -2585,7 +3006,7 @@
} }
public void dz() { public void dy() {
- Optional optional = this.getBedPosition(); - Optional optional = this.getBedPosition();
+ Optional<BlockPosition> optional = this.getBedPosition(); // CraftBukkit - decompile error + Optional<BlockPosition> optional = this.getBedPosition(); // CraftBukkit - decompile error
World world = this.world; World world = this.world;

Datei anzeigen

@ -21,7 +21,7 @@
@@ -673,7 +675,7 @@ @@ -673,7 +675,7 @@
@Override @Override
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) { protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).dS()) { if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).dR()) {
- entityinsentient.setGoalTarget(entityliving); - entityinsentient.setGoalTarget(entityliving);
+ entityinsentient.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit + entityinsentient.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit
} }

Datei anzeigen

@ -19,9 +19,9 @@
} }
private boolean a(Entity entity) { private boolean a(Entity entity) {
- this.angerLevel = this.ef(); - this.angerLevel = this.ee();
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.event.entity.PigZombieAngerEvent event = new org.bukkit.event.entity.PigZombieAngerEvent((org.bukkit.entity.PigZombie) this.getBukkitEntity(), (entity == null) ? null : entity.getBukkitEntity(), this.ef()); + org.bukkit.event.entity.PigZombieAngerEvent event = new org.bukkit.event.entity.PigZombieAngerEvent((org.bukkit.entity.PigZombie) this.getBukkitEntity(), (entity == null) ? null : entity.getBukkitEntity(), this.ee());
+ this.world.getServer().getPluginManager().callEvent(event); + this.world.getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ return false; + return false;

Datei anzeigen

@ -112,7 +112,7 @@
+ this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit + this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit
if (this.isSleeping()) { if (this.isSleeping()) {
this.dz(); this.dy();
@@ -157,7 +235,20 @@ @@ -157,7 +235,20 @@
Entity entity = this.getRootVehicle(); Entity entity = this.getRootVehicle();
Entity entity1 = this.getVehicle(); Entity entity1 = this.getVehicle();

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityRaider.java --- a/net/minecraft/server/EntityRaider.java
+++ b/net/minecraft/server/EntityRaider.java +++ b/net/minecraft/server/EntityRaider.java
@@ -397,7 +397,7 @@ @@ -399,7 +399,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityRaider entityraider = (EntityRaider) iterator.next(); EntityRaider entityraider = (EntityRaider) iterator.next();
@ -9,7 +9,7 @@
} }
} }
@@ -414,7 +414,7 @@ @@ -416,7 +416,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityRaider entityraider = (EntityRaider) iterator.next(); EntityRaider entityraider = (EntityRaider) iterator.next();
@ -18,7 +18,7 @@
entityraider.q(true); entityraider.q(true);
} }
@@ -488,7 +488,7 @@ @@ -490,7 +490,7 @@
private final T b; private final T b;

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/EntitySilverfish.java --- a/net/minecraft/server/EntitySilverfish.java
+++ b/net/minecraft/server/EntitySilverfish.java +++ b/net/minecraft/server/EntitySilverfish.java
@@ -19,7 +19,7 @@ @@ -18,7 +18,7 @@
this.goalSelector.a(3, this.c); this.goalSelector.a(3, this.b);
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false)); this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false));
this.goalSelector.a(5, new EntitySilverfish.PathfinderGoalSilverfishHideInBlock(this)); this.goalSelector.a(5, new EntitySilverfish.PathfinderGoalSilverfishHideInBlock(this));
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a()); - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a());
@ -9,7 +9,7 @@
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
} }
@@ -161,6 +161,11 @@ @@ -160,6 +160,11 @@
IBlockData iblockdata = world.getType(blockposition); IBlockData iblockdata = world.getType(blockposition);
if (BlockMonsterEggs.j(iblockdata)) { if (BlockMonsterEggs.j(iblockdata)) {
@ -21,7 +21,7 @@
world.setTypeAndData(blockposition, BlockMonsterEggs.e(iblockdata.getBlock()), 3); world.setTypeAndData(blockposition, BlockMonsterEggs.e(iblockdata.getBlock()), 3);
this.a.doSpawnEffect(); this.a.doSpawnEffect();
this.a.die(); this.a.die();
@@ -207,6 +212,11 @@ @@ -206,6 +211,11 @@
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
if (block instanceof BlockMonsterEggs) { if (block instanceof BlockMonsterEggs) {

Datei anzeigen

@ -26,7 +26,7 @@
+ // CraftBukkit start + // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.g, this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.g.random.nextInt(4) + 1)).isCancelled()) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.g, this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.g.random.nextInt(4) + 1)).isCancelled()) {
world.a((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F); world.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F);
world.setTypeAndData(this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.g.random.nextInt(4) + 1), 3); world.setTypeAndData(this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.g.random.nextInt(4) + 1), 3);
+ } + }
+ // CraftBukkit end + // CraftBukkit end

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/EntityTypes.java --- a/net/minecraft/server/EntityTypes.java
+++ b/net/minecraft/server/EntityTypes.java +++ b/net/minecraft/server/EntityTypes.java
@@ -131,7 +131,7 @@ @@ -129,7 +129,7 @@
private final Type<?> bh; private MinecraftKey bh;
private final EntitySize bi; private final EntitySize bi;
- private static <T extends Entity> EntityTypes<T> a(String s, EntityTypes.a<T> entitytypes_a) { - private static <T extends Entity> EntityTypes<T> a(String s, EntityTypes.a<T> entitytypes_a) {
@ -9,7 +9,7 @@
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_a.a(s)); return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_a.a(s));
} }
@@ -160,10 +160,16 @@ @@ -158,10 +158,16 @@
@Nullable @Nullable
public T spawnCreature(World world, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) { public T spawnCreature(World world, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
@ -28,7 +28,7 @@
} }
@Nullable @Nullable
@@ -325,7 +331,7 @@ @@ -327,7 +333,7 @@
} }
return entity; return entity;
@ -37,7 +37,7 @@
} }
private static Optional<Entity> b(NBTTagCompound nbttagcompound, World world) { private static Optional<Entity> b(NBTTagCompound nbttagcompound, World world) {
@@ -342,7 +348,8 @@ @@ -344,7 +350,8 @@
} }
public int getUpdateInterval() { public int getUpdateInterval() {
@ -47,8 +47,8 @@
} }
public boolean isDeltaTracking() { public boolean isDeltaTracking() {
@@ -372,7 +379,7 @@ @@ -376,7 +383,7 @@
this.b = enumcreaturetype; this.f = enumcreaturetype == EnumCreatureType.CREATURE || enumcreaturetype == EnumCreatureType.MISC;
} }
- public static <T extends Entity> EntityTypes.a<T> a(EntityTypes.b<T> entitytypes_b, EnumCreatureType enumcreaturetype) { - public static <T extends Entity> EntityTypes.a<T> a(EntityTypes.b<T> entitytypes_b, EnumCreatureType enumcreaturetype) {

Datei anzeigen

@ -17,7 +17,7 @@
public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder { public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder {
@@ -58,7 +68,7 @@ @@ -60,7 +70,7 @@
@Override @Override
public BehaviorController<EntityVillager> getBehaviorController() { public BehaviorController<EntityVillager> getBehaviorController() {
@ -26,16 +26,16 @@
} }
@Override @Override
@@ -122,7 +132,7 @@ @@ -124,7 +134,7 @@
@Override @Override
protected void mobTick() { protected void mobTick() {
this.world.getMethodProfiler().enter("brain"); this.world.getMethodProfiler().enter("brain");
- 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.dZ() && this.bE > 0) { if (!this.dY() && this.bE > 0) {
--this.bE; --this.bE;
@@ -132,7 +142,7 @@ @@ -134,7 +144,7 @@
this.bF = false; this.bF = false;
} }
@ -44,7 +44,7 @@
} }
} }
@@ -278,7 +288,14 @@ @@ -351,7 +361,14 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next(); MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
@ -60,7 +60,7 @@
} }
} }
@@ -598,7 +615,12 @@ @@ -673,7 +690,12 @@
entitywitch.setCustomNameVisible(this.getCustomNameVisible()); entitywitch.setCustomNameVisible(this.getCustomNameVisible());
} }
@ -74,7 +74,7 @@
this.die(); this.die();
} }
@@ -730,7 +752,7 @@ @@ -823,7 +845,7 @@
} }
private void b(long i) { private void b(long i) {
@ -83,7 +83,7 @@
} }
private boolean c(long i) { private boolean c(long i) {
@@ -779,7 +801,7 @@ @@ -872,7 +894,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)) {
@ -92,7 +92,7 @@
return entityirongolem; return entityirongolem;
} }
@@ -830,7 +852,7 @@ @@ -933,7 +955,7 @@
@Override @Override
public void e(BlockPosition blockposition) { public void e(BlockPosition blockposition) {
super.e(blockposition); super.e(blockposition);

Datei anzeigen

@ -15,7 +15,7 @@
private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
@@ -188,14 +195,38 @@ @@ -188,14 +195,38 @@
i = this.dW() - 1; i = this.dV() - 1;
if (i <= 0) { if (i <= 0) {
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
+ // CraftBukkit start + // CraftBukkit start

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityZombie.java --- a/net/minecraft/server/EntityZombie.java
+++ b/net/minecraft/server/EntityZombie.java +++ b/net/minecraft/server/EntityZombie.java
@@ -7,6 +7,14 @@ @@ -8,6 +8,14 @@
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -15,7 +15,7 @@
public class EntityZombie extends EntityMonster { public class EntityZombie extends EntityMonster {
protected static final IAttribute d = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance"); protected static final IAttribute d = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
@@ -22,6 +30,7 @@ @@ -23,6 +31,7 @@
private boolean bE; private boolean bE;
private int bF; private int bF;
public int drownedConversionTime; public int drownedConversionTime;
@ -23,7 +23,7 @@
public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) { public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
@@ -143,7 +152,11 @@ @@ -144,7 +153,11 @@
public void tick() { public void tick() {
if (!this.world.isClientSide && this.isAlive()) { if (!this.world.isClientSide && this.isAlive()) {
if (this.isDrownConverting()) { if (this.isDrownConverting()) {
@ -34,9 +34,9 @@
+ this.drownedConversionTime -= elapsedTicks; + this.drownedConversionTime -= elapsedTicks;
+ // CraftBukkit end + // CraftBukkit end
if (this.drownedConversionTime < 0) { if (this.drownedConversionTime < 0) {
this.eb(); this.ea();
} }
@@ -192,6 +205,7 @@ @@ -193,6 +206,7 @@
} }
public void startDrownedConversion(int i) { public void startDrownedConversion(int i) {
@ -44,7 +44,7 @@
this.drownedConversionTime = i; this.drownedConversionTime = i;
this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true); this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true);
} }
@@ -229,7 +243,12 @@ @@ -231,7 +245,12 @@
entityzombie.setCustomNameVisible(this.getCustomNameVisible()); entityzombie.setCustomNameVisible(this.getCustomNameVisible());
} }
@ -58,7 +58,7 @@
this.die(); this.die();
} }
} }
@@ -262,8 +281,8 @@ @@ -264,8 +283,8 @@
if (this.world.getType(blockposition).a((IBlockAccess) this.world, blockposition, (Entity) entityzombie) && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) { if (this.world.getType(blockposition).a((IBlockAccess) this.world, blockposition, (Entity) entityzombie) && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
entityzombie.setPosition((double) i1, (double) j1, (double) k1); entityzombie.setPosition((double) i1, (double) j1, (double) k1);
if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.i((Entity) entityzombie) && this.world.getCubes(entityzombie) && !this.world.containsLiquid(entityzombie.getBoundingBox())) { if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.i((Entity) entityzombie) && this.world.getCubes(entityzombie) && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
@ -67,9 +67,9 @@
+ this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit + this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
+ entityzombie.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.REINFORCEMENT_TARGET, true); // CraftBukkit + entityzombie.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.REINFORCEMENT_TARGET, true); // CraftBukkit
entityzombie.prepare(this.world, this.world.getDamageScaler(new BlockPosition(entityzombie)), EnumMobSpawn.REINFORCEMENT, (GroupDataEntity) null, (NBTTagCompound) null); entityzombie.prepare(this.world, this.world.getDamageScaler(new BlockPosition(entityzombie)), EnumMobSpawn.REINFORCEMENT, (GroupDataEntity) null, (NBTTagCompound) null);
this.getAttributeInstance(EntityZombie.d).b(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION)); this.getAttributeInstance(EntityZombie.d).addModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION));
entityzombie.getAttributeInstance(EntityZombie.d).b(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION)); entityzombie.getAttributeInstance(EntityZombie.d).addModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION));
@@ -287,7 +306,14 @@ @@ -289,7 +308,14 @@
float f = this.world.getDamageScaler(new BlockPosition(this)).b(); float f = this.world.getDamageScaler(new BlockPosition(this)).b();
if (this.getItemInMainHand().isEmpty() && this.isBurning() && this.random.nextFloat() < f * 0.3F) { if (this.getItemInMainHand().isEmpty() && this.isBurning() && this.random.nextFloat() < f * 0.3F) {
@ -85,7 +85,7 @@
} }
} }
@@ -377,7 +403,7 @@ @@ -379,7 +405,7 @@
EntityZombieVillager entityzombievillager = (EntityZombieVillager) EntityTypes.ZOMBIE_VILLAGER.a(this.world); EntityZombieVillager entityzombievillager = (EntityZombieVillager) EntityTypes.ZOMBIE_VILLAGER.a(this.world);
entityzombievillager.u(entityvillager); entityzombievillager.u(entityvillager);
@ -93,8 +93,8 @@
+ // entityvillager.die(); // CraftBukkit - moved down + // entityvillager.die(); // CraftBukkit - moved down
entityzombievillager.prepare(this.world, this.world.getDamageScaler(new BlockPosition(entityzombievillager)), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false), (NBTTagCompound) null); entityzombievillager.prepare(this.world, this.world.getDamageScaler(new BlockPosition(entityzombievillager)), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false), (NBTTagCompound) null);
entityzombievillager.setVillagerData(entityvillager.getVillagerData()); entityzombievillager.setVillagerData(entityvillager.getVillagerData());
entityzombievillager.setOffers(entityvillager.getOffers().a()); entityzombievillager.a((NBTBase) entityvillager.es().a((DynamicOps) DynamicOpsNBT.a).getValue());
@@ -389,7 +415,13 @@ @@ -392,7 +418,13 @@
entityzombievillager.setCustomNameVisible(entityvillager.getCustomNameVisible()); entityzombievillager.setCustomNameVisible(entityvillager.getCustomNameVisible());
} }
@ -109,7 +109,7 @@
this.world.a((EntityHuman) null, 1026, new BlockPosition(this), 0); this.world.a((EntityHuman) null, 1026, new BlockPosition(this), 0);
} }
@@ -436,7 +468,7 @@ @@ -439,7 +471,7 @@
entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entitychicken1.prepare(generatoraccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null); entitychicken1.prepare(generatoraccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null);
entitychicken1.r(true); entitychicken1.r(true);

Datei anzeigen

@ -11,15 +11,15 @@
public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder { public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder {
@@ -12,6 +16,7 @@ @@ -13,6 +17,7 @@
public UUID conversionPlayer; private NBTBase bB;
private NBTTagCompound bB; private NBTTagCompound bC;
private int bC; private int bD;
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field + private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) { public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
@@ -66,6 +71,11 @@ @@ -75,6 +80,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) {
@@ -113,8 +123,11 @@ @@ -122,8 +132,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);
} }
@@ -133,14 +146,20 @@ @@ -146,14 +159,20 @@
entityvillager.setAgeRaw(-24000); entityvillager.setAgeRaw(-24000);
} }
@ -68,7 +68,7 @@
if (this.conversionPlayer != null) { if (this.conversionPlayer != null) {
EntityHuman entityhuman = worldserver.b(this.conversionPlayer); EntityHuman entityhuman = worldserver.b(this.conversionPlayer);
@@ -150,7 +169,7 @@ @@ -163,7 +182,7 @@
} }
} }

Datei anzeigen

@ -64,7 +64,7 @@
this.a(f); this.a(f);
this.foodTickTimer = 0; this.foodTickTimer = 0;
} }
} else if (flag && this.foodLevel >= 18 && entityhuman.dQ()) { } else if (flag && this.foodLevel >= 18 && entityhuman.dP()) {
++this.foodTickTimer; ++this.foodTickTimer;
if (this.foodTickTimer >= 80) { if (this.foodTickTimer >= 80) {
- entityhuman.heal(1.0F); - entityhuman.heal(1.0F);

Datei anzeigen

@ -36,15 +36,7 @@
this.a = b(s); this.a = b(s);
} }
@@ -246,14 +246,14 @@ @@ -253,7 +253,7 @@
this.a(((CommandListenerWrapper) commandcontext.getSource()).getServer());
}
- protected void a(@Nullable MinecraftServer minecraftserver) {
+ public void a(@Nullable MinecraftServer minecraftserver) { // PAIL - private->public
if (minecraftserver != null) {
this.a.c.accept(minecraftserver, this.e());
}
} }
@ -56,7 +48,7 @@
@@ -283,7 +283,7 @@ @@ -283,7 +283,7 @@
} }
public T a() { public T getValue() {
- return (GameRules.GameRuleValue) this.b.apply(this); - return (GameRules.GameRuleValue) this.b.apply(this);
+ return this.b.apply(this); // CraftBukkit - decompile error + return this.b.apply(this); // CraftBukkit - decompile error
} }

Datei anzeigen

@ -62,7 +62,7 @@
}); });
} }
@@ -127,8 +136,36 @@ @@ -127,8 +136,36 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
EntityTypes<?> entitytypes = ((ItemMonsterEgg) itemstack.getItem()).b(itemstack.getTag()); EntityTypes<?> entitytypes = ((ItemMonsterEgg) itemstack.getItem()).b(itemstack.getTag());
+ // CraftBukkit start + // CraftBukkit start
@ -184,7 +184,7 @@
} }
@@ -199,9 +293,52 @@ @@ -199,9 +293,52 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
+ // CraftBukkit start + // CraftBukkit start
@ -307,7 +307,7 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
this.dispensed = true; this.dispensed = true;
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
IBlockData iblockdata = world.getType(blockposition); IBlockData iblockdata = world.getType(blockposition);
if (ItemFlintAndSteel.a(iblockdata, (GeneratorAccess) world, blockposition)) { if (ItemFlintAndSteel.a(iblockdata, (GeneratorAccess) world, blockposition)) {
@ -323,7 +323,7 @@
@@ -281,12 +472,57 @@ @@ -281,12 +472,57 @@
this.dispensed = true; this.dispensed = true;
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); + org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
+ CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack); + CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack);
@ -381,7 +381,7 @@
@@ -296,11 +532,40 @@ @@ -296,11 +532,40 @@
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null); - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null);
+ // EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null); + // EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null);
+ +
@ -415,14 +415,14 @@
+ // CraftBukkit end + // CraftBukkit end
world.addEntity(entitytntprimed); world.addEntity(entitytntprimed);
world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F); world.playSound((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F);
- itemstack.subtract(1); - itemstack.subtract(1);
+ // itemstack.subtract(1); // CraftBukkit - handled above + // itemstack.subtract(1); // CraftBukkit - handled above
return itemstack; return itemstack;
} }
})); }));
@@ -324,6 +589,30 @@ @@ -324,6 +589,30 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
+ // CraftBukkit start + // CraftBukkit start
@ -453,7 +453,7 @@
if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) { if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) {
world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, enumdirection.k() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.opposite().get2DRotationValue() * 4), 3); world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, enumdirection.k() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.opposite().get2DRotationValue() * 4), 3);
@@ -348,6 +637,30 @@ @@ -348,6 +637,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN; BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
+ // CraftBukkit start + // CraftBukkit start

Datei anzeigen

@ -10,5 +10,5 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.addEntity(entityarmorstand); world.addEntity(entityarmorstand);
world.a((EntityHuman) null, entityarmorstand.locX, entityarmorstand.locY, entityarmorstand.locZ, SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F); world.playSound((EntityHuman) null, entityarmorstand.locX, entityarmorstand.locY, entityarmorstand.locZ, SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F);
} }

Datei anzeigen

@ -16,8 +16,8 @@
SoundEffectType soundeffecttype = iblockdata1.r(); SoundEffectType soundeffecttype = iblockdata1.r();
- world.a(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F); - world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
+ // world.a(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F); + // world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
itemstack.subtract(1); itemstack.subtract(1);
return EnumInteractionResult.SUCCESS; return EnumInteractionResult.SUCCESS;
} }

Datei anzeigen

@ -7,10 +7,10 @@
+ // CraftBukkit start - obfuscator went a little crazy + // CraftBukkit start - obfuscator went a little crazy
+ /* + /*
this.a(new MinecraftKey("pull"), (itemstack, world, entityliving) -> { this.a(new MinecraftKey("pull"), (itemstack, world, entityliving) -> {
return entityliving == null ? 0.0F : (entityliving.dm().getItem() != Items.BOW ? 0.0F : (float) (itemstack.k() - entityliving.dn()) / 20.0F); return entityliving == null ? 0.0F : (entityliving.dl().getItem() != Items.BOW ? 0.0F : (float) (itemstack.k() - entityliving.dm()) / 20.0F);
}); });
this.a(new MinecraftKey("pulling"), (itemstack, world, entityliving) -> { this.a(new MinecraftKey("pulling"), (itemstack, world, entityliving) -> {
return entityliving != null && entityliving.isHandRaised() && entityliving.dm() == itemstack ? 1.0F : 0.0F; return entityliving != null && entityliving.isHandRaised() && entityliving.dl() == itemstack ? 1.0F : 0.0F;
}); });
+ */ + */
+ // CraftBukkit end + // CraftBukkit end
@ -48,4 +48,4 @@
+ // CraftBukkit end + // CraftBukkit end
} }
world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.i.nextFloat() * 0.4F + 1.2F) + f * 0.5F); world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.i.nextFloat() * 0.4F + 1.2F) + f * 0.5F);

Datei anzeigen

@ -7,7 +7,7 @@
+ // CraftBukkit start - obfuscator went a little crazy + // CraftBukkit start - obfuscator went a little crazy
+ /* + /*
this.a(new MinecraftKey("pull"), (itemstack, world, entityliving) -> { this.a(new MinecraftKey("pull"), (itemstack, world, entityliving) -> {
return entityliving != null && itemstack.getItem() == this ? (d(itemstack) ? 0.0F : (float) (itemstack.k() - entityliving.dn()) / (float) e(itemstack)) : 0.0F; return entityliving != null && itemstack.getItem() == this ? (d(itemstack) ? 0.0F : (float) (itemstack.k() - entityliving.dm()) / (float) e(itemstack)) : 0.0F;
}); });
@@ -24,6 +26,8 @@ @@ -24,6 +26,8 @@
this.a(new MinecraftKey("firework"), (itemstack, world, entityliving) -> { this.a(new MinecraftKey("firework"), (itemstack, world, entityliving) -> {
@ -56,6 +56,6 @@
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.a((EntityHuman) null, entityliving.locX, entityliving.locY, entityliving.locZ, SoundEffects.ITEM_CROSSBOW_SHOOT, SoundCategory.PLAYERS, 1.0F, f); world.playSound((EntityHuman) null, entityliving.locX, entityliving.locY, entityliving.locZ, SoundEffects.ITEM_CROSSBOW_SHOOT, SoundCategory.PLAYERS, 1.0F, f);
} }
} }

Datei anzeigen

@ -8,8 +8,8 @@
- itemstack.subtract(1); - itemstack.subtract(1);
- } - }
- -
- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.i.nextFloat() * 0.4F + 0.8F)); - world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.i.nextFloat() * 0.4F + 0.8F));
- entityhuman.getCooldownTracker().a(this, 20); - entityhuman.getCooldownTracker().setCooldown(this, 20);
+ // CraftBukkit start - change order + // CraftBukkit start - change order
if (!world.isClientSide) { if (!world.isClientSide) {
EntityEnderPearl entityenderpearl = new EntityEnderPearl(world, entityhuman); EntityEnderPearl entityenderpearl = new EntityEnderPearl(world, entityhuman);
@ -29,7 +29,7 @@
+ itemstack.subtract(1); + itemstack.subtract(1);
+ } + }
+ +
+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.i.nextFloat() * 0.4F + 0.8F)); + world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.i.nextFloat() * 0.4F + 0.8F));
+ entityhuman.getCooldownTracker().a(this, 20); + entityhuman.getCooldownTracker().a(this, 20);
+ // CraftBukkit end + // CraftBukkit end
+ +

Datei anzeigen

@ -25,10 +25,10 @@
@Override @Override
@@ -36,12 +42,23 @@ @@ -36,12 +42,23 @@
entityhuman.a(enumhand); entityhuman.a(enumhand);
world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_FISHING_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F)); world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_FISHING_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F));
} else { } else {
- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F)); - world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F));
+ // world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F)); + // world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F));
if (!world.isClientSide) { if (!world.isClientSide) {
i = EnchantmentManager.c(itemstack); i = EnchantmentManager.c(itemstack);
int j = EnchantmentManager.b(itemstack); int j = EnchantmentManager.b(itemstack);
@ -43,7 +43,7 @@
+ entityhuman.hookedFish = null; + entityhuman.hookedFish = null;
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); + return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
+ } + }
+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F)); + world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F));
+ world.addEntity(entityfishinghook); + world.addEntity(entityfishinghook);
+ // CraftBukkit end + // CraftBukkit end
} }

Datei anzeigen

@ -12,6 +12,6 @@
+ return EnumInteractionResult.PASS; + return EnumInteractionResult.PASS;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.a(entityhuman, blockposition1, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.i.nextFloat() * 0.4F + 0.8F); world.playSound(entityhuman, blockposition1, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.i.nextFloat() * 0.4F + 0.8F);
iblockdata = ((BlockFire) Blocks.FIRE).a((IBlockAccess) world, blockposition1); iblockdata = ((BlockFire) Blocks.FIRE).a((IBlockAccess) world, blockposition1);
world.setTypeAndData(blockposition1, iblockdata, 11); world.setTypeAndData(blockposition1, iblockdata, 11);

Datei anzeigen

@ -10,7 +10,7 @@
itemstack.subtract(1); itemstack.subtract(1);
} }
world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.i.nextFloat() * 0.4F + 0.8F)); world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.i.nextFloat() * 0.4F + 0.8F));
+ */ + */
if (!world.isClientSide) { if (!world.isClientSide) {
EntitySnowball entitysnowball = new EntitySnowball(world, entityhuman); EntitySnowball entitysnowball = new EntitySnowball(world, entityhuman);
@ -23,7 +23,7 @@
+ itemstack.subtract(1); + itemstack.subtract(1);
+ } + }
+ +
+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.i.nextFloat() * 0.4F + 0.8F)); + world.playSound((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.i.nextFloat() * 0.4F + 0.8F));
+ } else if (entityhuman instanceof EntityPlayer) { + } else if (entityhuman instanceof EntityPlayer) {
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
+ } + }

Datei anzeigen

@ -223,7 +223,7 @@
+ // SPIGOT-1288 - play sound stripped from ItemBlock + // SPIGOT-1288 - play sound stripped from ItemBlock
+ if (this.item instanceof ItemBlock) { + if (this.item instanceof ItemBlock) {
+ SoundEffectType soundeffecttype = ((ItemBlock) this.item).getBlock().stepSound; + SoundEffectType soundeffecttype = ((ItemBlock) this.item).getBlock().stepSound;
+ world.a(entityhuman, blockposition, soundeffecttype.e(), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F); + world.playSound(entityhuman, blockposition, soundeffecttype.e(), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
+ } + }
+ +
+ entityhuman.b(StatisticList.ITEM_USED.b(item)); + entityhuman.b(StatisticList.ITEM_USED.b(item));

Datei anzeigen

@ -7,7 +7,7 @@
+ // CraftBukkit start - obfuscator went a little crazy + // CraftBukkit start - obfuscator went a little crazy
+ /* + /*
this.a(new MinecraftKey("throwing"), (itemstack, world, entityliving) -> { this.a(new MinecraftKey("throwing"), (itemstack, world, entityliving) -> {
return entityliving != null && entityliving.isHandRaised() && entityliving.dm() == itemstack ? 1.0F : 0.0F; return entityliving != null && entityliving.isHandRaised() && entityliving.dl() == itemstack ? 1.0F : 0.0F;
}); });
+ */ + */
+ // CraftBukkit end + // CraftBukkit end
@ -46,7 +46,7 @@
+ entitythrowntrident.trident = itemstack.cloneItemStack(); // SPIGOT-4511 update since damage call moved + entitythrowntrident.trident = itemstack.cloneItemStack(); // SPIGOT-4511 update since damage call moved
+ // CraftBukkit end + // CraftBukkit end
+ +
world.a((EntityHuman) null, (Entity) entitythrowntrident, SoundEffects.ITEM_TRIDENT_THROW, SoundCategory.PLAYERS, 1.0F, 1.0F); world.playSound((EntityHuman) null, (Entity) entitythrowntrident, SoundEffects.ITEM_TRIDENT_THROW, SoundCategory.PLAYERS, 1.0F, 1.0F);
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
entityhuman.inventory.f(itemstack); entityhuman.inventory.f(itemstack);
@@ -58,6 +78,10 @@ @@ -58,6 +78,10 @@

Datei anzeigen

@ -39,10 +39,10 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
public void disconnect(IChatBaseComponent ichatbasecomponent) { @Override
try { public NetworkManager a() {
LoginListener.LOGGER.info("Disconnecting {}: {}", this.d(), ichatbasecomponent.getString()); return this.networkManager;
@@ -76,10 +97,12 @@ @@ -81,10 +102,12 @@
this.i = this.a(this.i); this.i = this.a(this.i);
} }
@ -57,8 +57,8 @@
+ // CraftBukkit end + // CraftBukkit end
} else { } else {
this.g = LoginListener.EnumProtocolState.ACCEPTED; this.g = LoginListener.EnumProtocolState.ACCEPTED;
if (this.server.ay() >= 0 && !this.networkManager.isLocal()) { if (this.server.az() >= 0 && !this.networkManager.isLocal()) {
@@ -93,9 +116,9 @@ @@ -98,9 +121,9 @@
if (entityplayer != null) { if (entityplayer != null) {
this.g = LoginListener.EnumProtocolState.DELAY_ACCEPT; this.g = LoginListener.EnumProtocolState.DELAY_ACCEPT;
@ -70,7 +70,7 @@
} }
} }
@@ -143,6 +166,43 @@ @@ -148,6 +171,43 @@
LoginListener.this.i = LoginListener.this.server.getMinecraftSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a()); LoginListener.this.i = LoginListener.this.server.getMinecraftSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a());
if (LoginListener.this.i != null) { if (LoginListener.this.i != null) {
@ -114,7 +114,7 @@
LoginListener.LOGGER.info("UUID of player {} is {}", LoginListener.this.i.getName(), LoginListener.this.i.getId()); LoginListener.LOGGER.info("UUID of player {} is {}", LoginListener.this.i.getName(), LoginListener.this.i.getId());
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else if (LoginListener.this.server.isEmbeddedServer()) { } else if (LoginListener.this.server.isEmbeddedServer()) {
@@ -162,6 +222,11 @@ @@ -167,6 +227,11 @@
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down", new Object[0])); LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down", new Object[0]));
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable"); LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
} }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -47,6 +47,13 @@ @@ -56,6 +56,13 @@
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -14,7 +14,7 @@
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable, Runnable { public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable, Runnable {
@@ -65,7 +72,7 @@ @@ -75,7 +82,7 @@
public final DataFixer dataConverterManager; public final DataFixer dataConverterManager;
private String serverIp; private String serverIp;
private int serverPort = -1; private int serverPort = -1;
@ -23,18 +23,18 @@
private PlayerList playerList; private PlayerList playerList;
private volatile boolean isRunning = true; private volatile boolean isRunning = true;
private boolean isStopped; private boolean isStopped;
@@ -103,7 +110,7 @@ @@ -113,7 +120,7 @@
private final GameProfileRepository gameProfileRepository; private final GameProfileRepository gameProfileRepository;
private final UserCache userCache; private final UserCache userCache;
private long Y; private long Z;
- public final Thread serverThread = (Thread) SystemUtils.a((Object) (new Thread(this, "Server thread")), (thread) -> { - public final Thread serverThread = (Thread) SystemUtils.a((Object) (new Thread(this, "Server thread")), (thread) -> {
+ public final Thread serverThread = (Thread) SystemUtils.a((new Thread(this, "Server thread")), (thread) -> { // CraftBukkit - decompile error + public final Thread serverThread = (Thread) SystemUtils.a((new Thread(this, "Server thread")), (thread) -> { // CraftBukkit - decompile error
thread.setUncaughtExceptionHandler((thread1, throwable) -> { thread.setUncaughtExceptionHandler((thread1, throwable) -> {
MinecraftServer.LOGGER.error(throwable); MinecraftServer.LOGGER.error(throwable);
}); });
@@ -132,7 +139,21 @@ @@ -142,7 +149,21 @@
@Nullable @Nullable
private String au; private String av;
- public MinecraftServer(File file, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory, String s) { - public MinecraftServer(File file, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory, String s) {
+ // CraftBukkit start + // CraftBukkit start
@ -53,11 +53,11 @@
+ +
+ public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory, String s) { + public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory, String s) {
super("Server"); super("Server");
this.ad = new ResourceManager(EnumResourcePackType.SERVER_DATA, this.serverThread); this.ae = new ResourceManager(EnumResourcePackType.SERVER_DATA, this.serverThread);
this.resourcePackRepository = new ResourcePackRepository<>(ResourcePackLoader::new); this.resourcePackRepository = new ResourcePackRepository<>(ResourcePackLoader::new);
@@ -145,15 +166,15 @@ @@ -155,15 +176,15 @@
this.an = new CustomFunctionData(this); this.ao = new CustomFunctionData(this);
this.ao = new CircularTimer(); this.ap = new CircularTimer();
this.proxy = proxy; this.proxy = proxy;
- this.commandDispatcher = commanddispatcher; - this.commandDispatcher = commanddispatcher;
+ this.commandDispatcher = this.vanillaCommandDispatcher = commanddispatcher; // CraftBukkit + this.commandDispatcher = this.vanillaCommandDispatcher = commanddispatcher; // CraftBukkit
@ -73,12 +73,12 @@
- this.convertable = new Convertable(file.toPath(), file.toPath().resolve("../backups"), datafixer); - this.convertable = new Convertable(file.toPath(), file.toPath().resolve("../backups"), datafixer);
+ // this.convertable = new Convertable(file.toPath(), file.toPath().resolve("../backups"), datafixer); // CraftBukkit - moved to DedicatedServer.init + // this.convertable = new Convertable(file.toPath(), file.toPath().resolve("../backups"), datafixer); // CraftBukkit - moved to DedicatedServer.init
this.dataConverterManager = datafixer; this.dataConverterManager = datafixer;
this.ad.a((IReloadListener) this.ai); this.ae.a((IReloadListener) this.aj);
this.ad.a((IReloadListener) this.ah); this.ae.a((IReloadListener) this.ai);
@@ -162,7 +183,32 @@ @@ -172,7 +193,32 @@
this.ad.a((IReloadListener) this.am); this.ae.a((IReloadListener) this.an);
this.executorService = SystemUtils.e(); this.executorService = SystemUtils.e();
this.J = s; this.K = s;
+ // CraftBukkit start + // CraftBukkit start
+ this.options = options; + this.options = options;
+ // Try to see if we're actually running in a terminal, disable jline if not + // Try to see if we're actually running in a terminal, disable jline if not
@ -108,7 +108,7 @@
private void initializeScoreboards(WorldPersistentData worldpersistentdata) { private void initializeScoreboards(WorldPersistentData worldpersistentdata) {
PersistentScoreboard persistentscoreboard = (PersistentScoreboard) worldpersistentdata.a(PersistentScoreboard::new, "scoreboard"); PersistentScoreboard persistentscoreboard = (PersistentScoreboard) worldpersistentdata.a(PersistentScoreboard::new, "scoreboard");
@@ -198,11 +244,11 @@ @@ -208,11 +254,11 @@
} }
if (this.forceUpgrade) { if (this.forceUpgrade) {
@ -123,7 +123,7 @@
IChatBaseComponent ichatbasecomponent = null; IChatBaseComponent ichatbasecomponent = null;
while (!worldupgrader.b()) { while (!worldupgrader.b()) {
@@ -241,8 +287,9 @@ @@ -251,8 +297,9 @@
} }
protected void a(String s, String s1, long i, WorldType worldtype, JsonElement jsonelement) { protected void a(String s, String s1, long i, WorldType worldtype, JsonElement jsonelement) {
@ -134,7 +134,7 @@
WorldNBTStorage worldnbtstorage = this.getConvertable().a(s, this); WorldNBTStorage worldnbtstorage = this.getConvertable().a(s, this);
this.a(this.getWorld(), worldnbtstorage); this.a(this.getWorld(), worldnbtstorage);
@@ -267,24 +314,134 @@ @@ -277,24 +324,134 @@
} }
this.a(worldnbtstorage.getDirectory(), worlddata); this.a(worldnbtstorage.getDirectory(), worlddata);
@ -158,10 +158,7 @@
+ continue; + continue;
+ } + }
+ } + }
+
- protected void a(WorldNBTStorage worldnbtstorage, WorldData worlddata, WorldSettings worldsettings, WorldLoadListener worldloadlistener) {
- if (this.isDemoMode()) {
- worlddata.a(MinecraftServer.c);
+ if (j == 2) { + if (j == 2) {
+ if (server.getAllowEnd()) { + if (server.getAllowEnd()) {
+ dimension = 1; + dimension = 1;
@ -231,7 +228,10 @@
+ MinecraftServer.LOGGER.info("---- Migration of old " + worldType + " folder failed ----"); + MinecraftServer.LOGGER.info("---- Migration of old " + worldType + " folder failed ----");
+ } + }
+ } + }
+
- protected void a(WorldNBTStorage worldnbtstorage, WorldData worlddata, WorldSettings worldsettings, WorldLoadListener worldloadlistener) {
- if (this.isDemoMode()) {
- worlddata.a(MinecraftServer.c);
+ WorldNBTStorage worldnbtstorage = new WorldNBTStorage(server.getWorldContainer(), name, this, this.dataConverterManager); + WorldNBTStorage worldnbtstorage = new WorldNBTStorage(server.getWorldContainer(), name, this, this.dataConverterManager);
+ // world =, b0 to dimension, s1 to name, added Environment and gen + // world =, b0 to dimension, s1 to name, added Environment and gen
+ worlddata = worldnbtstorage.getWorldData(); + worlddata = worldnbtstorage.getWorldData();
@ -282,7 +282,7 @@
if (!worlddata.u()) { if (!worlddata.u()) {
try { try {
@@ -308,23 +465,8 @@ @@ -318,23 +475,8 @@
worlddata.d(true); worlddata.d(true);
} }
@ -307,7 +307,7 @@
private void a(WorldData worlddata) { private void a(WorldData worlddata) {
worlddata.f(false); worlddata.f(false);
@@ -343,6 +485,25 @@ @@ -353,6 +495,25 @@
protected void a(File file, WorldData worlddata) { protected void a(File file, WorldData worlddata) {
this.resourcePackRepository.a((ResourcePackSource) (new ResourcePackSourceVanilla())); this.resourcePackRepository.a((ResourcePackSource) (new ResourcePackSourceVanilla()));
this.resourcePackFolder = new ResourcePackSourceFolder(new File(file, "datapacks")); this.resourcePackFolder = new ResourcePackSourceFolder(new File(file, "datapacks"));
@ -333,7 +333,7 @@
this.resourcePackRepository.a((ResourcePackSource) this.resourcePackFolder); this.resourcePackRepository.a((ResourcePackSource) this.resourcePackFolder);
this.resourcePackRepository.a(); this.resourcePackRepository.a();
List<ResourcePackLoader> list = Lists.newArrayList(); List<ResourcePackLoader> list = Lists.newArrayList();
@@ -363,11 +524,18 @@ @@ -373,11 +534,18 @@
this.b(worlddata); this.b(worlddata);
} }
@ -355,7 +355,7 @@
BlockPosition blockposition = worldserver.getSpawn(); BlockPosition blockposition = worldserver.getSpawn();
worldloadlistener.a(new ChunkCoordIntPair(blockposition)); worldloadlistener.a(new ChunkCoordIntPair(blockposition));
@@ -378,17 +546,21 @@ @@ -388,17 +556,21 @@
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) {
@ -386,7 +386,7 @@
if (forcedchunk != null) { if (forcedchunk != null) {
WorldServer worldserver1 = this.getWorldServer(dimensionmanager); WorldServer worldserver1 = this.getWorldServer(dimensionmanager);
@@ -403,10 +575,16 @@ @@ -413,10 +585,16 @@
} }
} }
@ -405,7 +405,7 @@
} }
protected void a(String s, WorldNBTStorage worldnbtstorage) { protected void a(String s, WorldNBTStorage worldnbtstorage) {
@@ -451,12 +629,16 @@ @@ -463,12 +641,16 @@
} }
} }
@ -422,7 +422,7 @@
return flag3; return flag3;
} }
@@ -465,8 +647,29 @@ @@ -477,8 +659,29 @@
this.stop(); this.stop();
} }
@ -452,7 +452,7 @@
if (this.getServerConnection() != null) { if (this.getServerConnection() != null) {
this.getServerConnection().b(); this.getServerConnection().b();
} }
@@ -475,6 +678,7 @@ @@ -487,6 +690,7 @@
MinecraftServer.LOGGER.info("Saving players"); MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers(); this.playerList.savePlayers();
this.playerList.shutdown(); this.playerList.shutdown();
@ -460,7 +460,7 @@
} }
MinecraftServer.LOGGER.info("Saving worlds"); MinecraftServer.LOGGER.info("Saving worlds");
@@ -544,14 +748,16 @@ @@ -556,14 +760,16 @@
while (this.isRunning) { while (this.isRunning) {
long i = SystemUtils.getMonotonicMillis() - this.nextTick; long i = SystemUtils.getMonotonicMillis() - this.nextTick;
@ -476,9 +476,9 @@
+ MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit + MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
this.nextTick += 50L; this.nextTick += 50L;
if (this.S) { if (this.T) {
this.S = false; this.T = false;
@@ -598,6 +804,12 @@ @@ -610,6 +816,12 @@
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1); MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally { } finally {
@ -491,13 +491,13 @@
this.exit(); this.exit();
} }
@@ -606,8 +818,15 @@ @@ -618,8 +830,15 @@
} }
private boolean canSleepForTick() { private boolean canSleepForTick() {
- return this.isEntered() || SystemUtils.getMonotonicMillis() < (this.ab ? this.aa : this.nextTick); - return this.isEntered() || SystemUtils.getMonotonicMillis() < (this.ac ? this.ab : this.nextTick);
+ // CraftBukkit start + // CraftBukkit start
+ return this.forceTicks || this.isEntered() || SystemUtils.getMonotonicMillis() < (this.ab ? this.aa : this.nextTick); + return this.forceTicks || this.isEntered() || SystemUtils.getMonotonicMillis() < (this.ac ? this.ab : this.nextTick);
+ } + }
+ +
+ private void executeModerately() { + private void executeModerately() {
@ -508,7 +508,7 @@
protected void sleepForTick() { protected void sleepForTick() {
this.executeAll(); this.executeAll();
@@ -708,7 +927,7 @@ @@ -720,7 +939,7 @@
this.serverPing.b().a(agameprofile); this.serverPing.b().a(agameprofile);
} }
@ -517,7 +517,7 @@
MinecraftServer.LOGGER.debug("Autosave started"); MinecraftServer.LOGGER.debug("Autosave started");
this.methodProfiler.enter("save"); this.methodProfiler.enter("save");
this.playerList.savePlayers(); this.playerList.savePlayers();
@@ -738,23 +957,40 @@ @@ -750,23 +969,40 @@
} }
protected void b(BooleanSupplier booleansupplier) { protected void b(BooleanSupplier booleansupplier) {
@ -559,7 +559,7 @@
this.methodProfiler.enter("tick"); this.methodProfiler.enter("tick");
@@ -793,7 +1029,8 @@ @@ -805,7 +1041,8 @@
this.tickables.add(runnable); this.tickables.add(runnable);
} }
@ -569,7 +569,7 @@
OptionParser optionparser = new OptionParser(); OptionParser optionparser = new OptionParser();
OptionSpec<Void> optionspec = optionparser.accepts("nogui"); OptionSpec<Void> optionspec = optionparser.accepts("nogui");
OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits"); OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
@@ -816,15 +1053,17 @@ @@ -828,15 +1065,17 @@
optionparser.printHelpOn(System.err); optionparser.printHelpOn(System.err);
return; return;
} }
@ -589,7 +589,7 @@
MinecraftServer.LOGGER.info("Initialized '" + java_nio_file_path.toAbsolutePath().toString() + "' and '" + java_nio_file_path1.toAbsolutePath().toString() + "'"); MinecraftServer.LOGGER.info("Initialized '" + java_nio_file_path.toAbsolutePath().toString() + "' and '" + java_nio_file_path1.toAbsolutePath().toString() + "'");
return; return;
} }
@@ -836,14 +1075,15 @@ @@ -848,14 +1087,15 @@
DispenserRegistry.init(); DispenserRegistry.init();
DispenserRegistry.c(); DispenserRegistry.c();
@ -608,7 +608,7 @@
dedicatedserver.i((String) optionset.valueOf(optionspec7)); dedicatedserver.i((String) optionset.valueOf(optionspec7));
dedicatedserver.setPort((Integer) optionset.valueOf(optionspec10)); dedicatedserver.setPort((Integer) optionset.valueOf(optionspec10));
dedicatedserver.e(optionset.has(optionspec2)); dedicatedserver.e(optionset.has(optionspec2));
@@ -866,6 +1106,29 @@ @@ -878,6 +1118,29 @@
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER)); thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER));
Runtime.getRuntime().addShutdownHook(thread); Runtime.getRuntime().addShutdownHook(thread);
@ -638,7 +638,7 @@
} catch (Exception exception) { } catch (Exception exception) {
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception); MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
} }
@@ -885,7 +1148,9 @@ @@ -897,7 +1160,9 @@
} }
public void startServerThread() { public void startServerThread() {
@ -648,7 +648,7 @@
} }
public File d(String s) { public File d(String s) {
@@ -940,7 +1205,7 @@ @@ -952,7 +1217,7 @@
} }
public String getServerModName() { public String getServerModName() {
@ -657,19 +657,19 @@
} }
public CrashReport b(CrashReport crashreport) { public CrashReport b(CrashReport crashreport) {
@@ -979,7 +1244,7 @@ @@ -991,7 +1256,7 @@
} }
public boolean E() { public boolean F() {
- return this.universe != null; - return this.universe != null;
+ return true; // CraftBukkit + return true; // CraftBukkit
} }
@Override @Override
@@ -1482,4 +1747,16 @@ @@ -1690,4 +1955,16 @@
} }
public abstract boolean b(GameProfile gameprofile); }
+ +
+ // CraftBukkit start + // CraftBukkit start
+ @Override + @Override

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/NetworkManager.java --- a/net/minecraft/server/NetworkManager.java
+++ b/net/minecraft/server/NetworkManager.java +++ b/net/minecraft/server/NetworkManager.java
@@ -129,7 +129,7 @@ @@ -127,7 +127,7 @@
} }
private static <T extends PacketListener> void a(Packet<T> packet, PacketListener packetlistener) { private static <T extends PacketListener> void a(Packet<T> packet, PacketListener packetlistener) {
@ -9,12 +9,12 @@
} }
public void setPacketListener(PacketListener packetlistener) { public void setPacketListener(PacketListener packetlistener) {
@@ -244,7 +244,7 @@ @@ -234,7 +234,7 @@
public void close(IChatBaseComponent ichatbasecomponent) { public void close(IChatBaseComponent ichatbasecomponent) {
if (this.channel.isOpen()) { if (this.channel.isOpen()) {
- this.channel.close().awaitUninterruptibly(); - this.channel.close().awaitUninterruptibly();
+ this.channel.close(); // We can't wait as this may be called from an event loop. + this.channel.close(); // We can't wait as this may be called from an event loop.
this.n = ichatbasecomponent; this.m = ichatbasecomponent;
} }

Datei anzeigen

@ -17,7 +17,7 @@
public class PacketStatusListener implements PacketStatusInListener { public class PacketStatusListener implements PacketStatusInListener {
private static final IChatBaseComponent a = new ChatMessage("multiplayer.status.request_handled", new Object[0]); private static final IChatBaseComponent a = new ChatMessage("multiplayer.status.request_handled", new Object[0]);
@@ -21,8 +32,96 @@ @@ -26,8 +37,96 @@
this.networkManager.close(PacketStatusListener.a); this.networkManager.close(PacketStatusListener.a);
} else { } else {
this.d = true; this.d = true;

Datei anzeigen

@ -25,7 +25,7 @@
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) { public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(chunkstatus.c()); CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(chunkstatus.c());
@@ -76,9 +85,9 @@ @@ -80,9 +89,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();
@ -36,8 +36,8 @@
+ return either == null ? null : (Chunk) either.left().orElse(null); // CraftBukkit - decompile error + return either == null ? null : (Chunk) either.left().orElse(null); // CraftBukkit - decompile error
} }
public CompletableFuture<IChunkAccess> getChunkSave() { @Nullable
@@ -201,7 +210,7 @@ @@ -223,7 +232,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) {
@ -46,7 +46,7 @@
if (either == null || either.left().isPresent()) { if (either == null || either.left().isPresent()) {
return completablefuture; return completablefuture;
@@ -256,6 +265,24 @@ @@ -278,6 +287,24 @@
boolean flag1 = this.ticketLevel <= PlayerChunkMap.GOLDEN_TICKET; boolean flag1 = this.ticketLevel <= PlayerChunkMap.GOLDEN_TICKET;
PlayerChunk.State playerchunk_state = getChunkState(this.oldTicketLevel); PlayerChunk.State playerchunk_state = getChunkState(this.oldTicketLevel);
PlayerChunk.State playerchunk_state1 = getChunkState(this.ticketLevel); PlayerChunk.State playerchunk_state1 = getChunkState(this.ticketLevel);
@ -71,7 +71,7 @@
CompletableFuture completablefuture; CompletableFuture completablefuture;
if (flag) { if (flag) {
@@ -287,7 +314,7 @@ @@ -309,7 +336,7 @@
if (flag2 && !flag3) { if (flag2 && !flag3) {
completablefuture = this.fullChunkFuture; completablefuture = this.fullChunkFuture;
this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
@ -80,7 +80,7 @@
playerchunkmap.getClass(); playerchunkmap.getClass();
return either1.ifLeft(playerchunkmap::a); return either1.ifLeft(playerchunkmap::a);
})); }));
@@ -325,6 +352,20 @@ @@ -347,6 +374,20 @@
this.w.a(this.location, this::k, this.ticketLevel, this::d); this.w.a(this.location, this::k, this.ticketLevel, this::d);
this.oldTicketLevel = this.ticketLevel; this.oldTicketLevel = this.ticketLevel;

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/PlayerChunkMap.java --- a/net/minecraft/server/PlayerChunkMap.java
+++ b/net/minecraft/server/PlayerChunkMap.java +++ b/net/minecraft/server/PlayerChunkMap.java
@@ -37,6 +37,7 @@ @@ -42,6 +42,7 @@
import org.apache.commons.lang3.mutable.MutableBoolean; 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;
@ -8,16 +8,7 @@
public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -58,7 +59,7 @@ @@ -72,6 +73,31 @@
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxWorldGen;
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain;
public final WorldLoadListener worldLoadListener;
- private final PlayerChunkMap.a u;
+ public final PlayerChunkMap.a u; // CraftBukkit - private -> public // PAIL chunkDistanceManager
private final AtomicInteger v;
private final DefinedStructureManager definedStructureManager;
private final File x;
@@ -67,6 +68,31 @@
private final Queue<Runnable> A; private final Queue<Runnable> A;
private int viewDistance; private int viewDistance;
@ -49,7 +40,7 @@
public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator<?> chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i) { public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator<?> chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i) {
super(new File(worldserver.getWorldProvider().getDimensionManager().a(file), "region"), datafixer); super(new File(worldserver.getWorldProvider().getDimensionManager().a(file), "region"), datafixer);
this.visibleChunks = this.updatingChunks.clone(); this.visibleChunks = this.updatingChunks.clone();
@@ -184,9 +210,12 @@ @@ -191,9 +217,12 @@
return completablefuture1.thenApply((list1) -> { return completablefuture1.thenApply((list1) -> {
List<IChunkAccess> list2 = Lists.newArrayList(); List<IChunkAccess> list2 = Lists.newArrayList();
@ -64,7 +55,7 @@
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();
@@ -284,7 +313,7 @@ @@ -291,7 +320,7 @@
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.x.getName()); PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.x.getName());
} else { } else {
this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> { this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
@ -73,7 +64,7 @@
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) { if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
this.saveChunk(ichunkaccess); this.saveChunk(ichunkaccess);
@@ -295,7 +324,6 @@ @@ -302,7 +331,6 @@
} }
} }
@ -81,7 +72,7 @@
protected void unloadChunks(BooleanSupplier booleansupplier) { protected void unloadChunks(BooleanSupplier booleansupplier) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@@ -334,7 +362,7 @@ @@ -341,7 +369,7 @@
private void a(long i, PlayerChunk playerchunk) { private void a(long i, PlayerChunk playerchunk) {
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave(); CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave();
@ -90,7 +81,7 @@
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkSave(); CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkSave();
if (completablefuture1 != completablefuture) { if (completablefuture1 != completablefuture) {
@@ -483,7 +511,7 @@ @@ -490,7 +518,7 @@
return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
}); });
}, (runnable) -> { }, (runnable) -> {
@ -99,7 +90,7 @@
}); });
} }
@@ -564,7 +592,7 @@ @@ -571,7 +599,7 @@
long i = playerchunk.i().pair(); long i = playerchunk.i().pair();
playerchunk.getClass(); playerchunk.getClass();
@ -108,7 +99,7 @@
}); });
} }
@@ -581,7 +609,7 @@ @@ -588,7 +616,7 @@
return Either.left(chunk); return Either.left(chunk);
}); });
}, (runnable) -> { }, (runnable) -> {
@ -117,7 +108,7 @@
}); });
completablefuture1.thenAcceptAsync((either) -> { completablefuture1.thenAcceptAsync((either) -> {
@@ -595,7 +623,7 @@ @@ -602,7 +630,7 @@
return Either.left(chunk); return Either.left(chunk);
}); });
}, (runnable) -> { }, (runnable) -> {
@ -126,7 +117,7 @@
}); });
return completablefuture1; return completablefuture1;
} }
@@ -609,7 +637,7 @@ @@ -616,7 +644,7 @@
return chunk; return chunk;
}); });
}, (runnable) -> { }, (runnable) -> {
@ -135,7 +126,26 @@
}); });
} }
@@ -724,7 +752,7 @@ @@ -740,7 +768,8 @@
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
});
- csvwriter.a(chunkcoordintpair.x, chunkcoordintpair.z, playerchunk.getTicketLevel(), optional.isPresent(), optional.map(IChunkAccess::getChunkStatus).orElse((Object) null), optional1.map(Chunk::getState).orElse((Object) null), a(playerchunk.c()), a(playerchunk.a()), a(playerchunk.b()), this.chunkDistanceManager.c(entry.getLongKey()), !this.isOutsideOfRange(chunkcoordintpair), optional1.map((chunk) -> {
+ // Craftbukkit - decompile error
+ csvwriter.a(chunkcoordintpair.x, chunkcoordintpair.z, playerchunk.getTicketLevel(), optional.isPresent(), optional.map(IChunkAccess::getChunkStatus).orElse(null), optional1.map(Chunk::getState).orElse(null), a(playerchunk.c()), a(playerchunk.a()), a(playerchunk.b()), this.chunkDistanceManager.c(entry.getLongKey()), !this.isOutsideOfRange(chunkcoordintpair), optional1.map((chunk) -> {
return Stream.of(chunk.getEntitySlices()).mapToInt(EntitySlice::size).sum();
}).orElse(0), optional1.map((chunk) -> {
return chunk.getTileEntities().size();
@@ -751,7 +780,7 @@
private static String a(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
try {
- Either<Chunk, PlayerChunk.Failure> either = (Either) completablefuture.getNow((Object) null);
+ Either<Chunk, PlayerChunk.Failure> either = (Either) completablefuture.getNow(null); // Craftbukkit - decompile error
return either != null ? (String) either.map((chunk) -> {
return "done";
@@ -769,7 +798,7 @@
private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair); NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
@ -144,7 +154,7 @@
} }
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) { boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
@@ -1056,7 +1084,7 @@ @@ -1101,7 +1130,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) {
@ -153,16 +163,16 @@
this.tracker = entity; this.tracker = entity;
this.trackingDistance = i; this.trackingDistance = i;
this.e = SectionPosition.a(entity); this.e = SectionPosition.a(entity);
@@ -1109,7 +1137,7 @@ @@ -1154,7 +1183,7 @@
public void updatePlayer(EntityPlayer entityplayer) { public void updatePlayer(EntityPlayer entityplayer) {
if (entityplayer != this.tracker) { if (entityplayer != this.tracker) {
- Vec3D vec3d = (new Vec3D(entityplayer.locX, entityplayer.locY, entityplayer.locZ)).d(this.trackerEntry.b()); - Vec3D vec3d = (new Vec3D(entityplayer.locX, entityplayer.locY, entityplayer.locZ)).d(this.trackerEntry.b());
+ Vec3D vec3d = (new Vec3D(entityplayer.locX, entityplayer.locY, entityplayer.locZ)).d(this.tracker.ci()); // MC-155077, SPIGOT-5113 // PAIL getPositionVector + Vec3D vec3d = (new Vec3D(entityplayer.locX, entityplayer.locY, entityplayer.locZ)).d(this.tracker.getPositionVector()); // MC-155077, SPIGOT-5113
int i = Math.min(this.trackingDistance, (PlayerChunkMap.this.viewDistance - 1) * 16); int i = Math.min(this.trackingDistance, (PlayerChunkMap.this.viewDistance - 1) * 16);
boolean flag = vec3d.x >= (double) (-i) && vec3d.x <= (double) i && vec3d.z >= (double) (-i) && vec3d.z <= (double) i && this.tracker.a(entityplayer); boolean flag = vec3d.x >= (double) (-i) && vec3d.x <= (double) i && vec3d.z >= (double) (-i) && vec3d.z <= (double) i && this.tracker.a(entityplayer);
@@ -1125,6 +1153,17 @@ @@ -1170,6 +1199,17 @@
} }
} }

Datei anzeigen

@ -126,7 +126,7 @@
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0])); this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
} }
@@ -149,16 +226,46 @@ @@ -150,16 +227,46 @@
return this.minecraftServer.b(this.player.getProfile()); return this.minecraftServer.b(this.player.getProfile());
} }
@ -174,7 +174,7 @@
} }
@Override @Override
@@ -199,7 +306,34 @@ @@ -200,7 +307,34 @@
double d9 = entity.getMot().g(); double d9 = entity.getMot().g();
double d10 = d6 * d6 + d7 * d7 + d8 * d8; double d10 = d6 * d6 + d7 * d7 + d8 * d8;
@ -210,7 +210,7 @@
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8); PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8);
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
return; return;
@@ -229,14 +363,72 @@ @@ -230,14 +364,72 @@
} }
entity.setLocation(d3, d4, d5, f, f1); entity.setLocation(d3, d4, d5, f, f1);
@ -283,7 +283,7 @@
this.player.getWorldServer().getChunkProvider().movePlayer(this.player); this.player.getWorldServer().getChunkProvider().movePlayer(this.player);
this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2); this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2);
this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.a(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.a(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -251,7 +443,7 @@ @@ -252,7 +444,7 @@
@Override @Override
public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) { public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) {
PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer());
@ -292,7 +292,7 @@
this.player.setLocation(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); this.player.setLocation(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
this.o = this.teleportPos.x; this.o = this.teleportPos.x;
this.p = this.teleportPos.y; this.p = this.teleportPos.y;
@@ -261,6 +453,7 @@ @@ -262,6 +454,7 @@
} }
this.teleportPos = null; this.teleportPos = null;
@ -300,7 +300,7 @@
} }
} }
@@ -269,7 +462,7 @@ @@ -270,7 +463,7 @@
public void a(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) { public void a(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
PlayerConnectionUtils.ensureMainThread(packetplayinrecipedisplayed, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinrecipedisplayed, this, this.player.getWorldServer());
if (packetplayinrecipedisplayed.b() == PacketPlayInRecipeDisplayed.Status.SHOWN) { if (packetplayinrecipedisplayed.b() == PacketPlayInRecipeDisplayed.Status.SHOWN) {
@ -309,7 +309,7 @@
RecipeBookServer recipebookserver = this.player.B(); RecipeBookServer recipebookserver = this.player.B();
optional.ifPresent(recipebookserver::e); optional.ifPresent(recipebookserver::e);
@@ -303,6 +496,12 @@ @@ -304,6 +497,12 @@
@Override @Override
public void a(PacketPlayInTabComplete packetplayintabcomplete) { public void a(PacketPlayInTabComplete packetplayintabcomplete) {
PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer());
@ -322,7 +322,7 @@
StringReader stringreader = new StringReader(packetplayintabcomplete.c()); StringReader stringreader = new StringReader(packetplayintabcomplete.c());
if (stringreader.canRead() && stringreader.peek() == '/') { if (stringreader.canRead() && stringreader.peek() == '/') {
@@ -312,7 +511,8 @@ @@ -313,7 +512,8 @@
ParseResults<CommandListenerWrapper> parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener()); ParseResults<CommandListenerWrapper> parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener());
this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
@ -332,7 +332,7 @@
}); });
} }
@@ -517,6 +717,7 @@ @@ -518,6 +718,7 @@
if (container instanceof ContainerMerchant) { if (container instanceof ContainerMerchant) {
ContainerMerchant containermerchant = (ContainerMerchant) container; ContainerMerchant containermerchant = (ContainerMerchant) container;
@ -340,7 +340,7 @@
containermerchant.d(i); containermerchant.d(i);
containermerchant.g(i); containermerchant.g(i);
@@ -526,6 +727,15 @@ @@ -527,6 +728,15 @@
@Override @Override
public void a(PacketPlayInBEdit packetplayinbedit) { public void a(PacketPlayInBEdit packetplayinbedit) {
@ -356,7 +356,7 @@
ItemStack itemstack = packetplayinbedit.b(); ItemStack itemstack = packetplayinbedit.b();
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
@@ -554,9 +764,11 @@ @@ -555,9 +765,11 @@
} }
itemstack2.a("pages", (NBTBase) nbttaglist); itemstack2.a("pages", (NBTBase) nbttaglist);
@ -369,7 +369,7 @@
} }
} }
@@ -598,7 +810,7 @@ @@ -599,7 +811,7 @@
} else { } else {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@ -378,7 +378,7 @@
if (this.e == 0) { if (this.e == 0) {
this.syncPosition(); this.syncPosition();
} }
@@ -608,13 +820,21 @@ @@ -609,13 +821,21 @@
this.A = this.e; this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
} }
@ -401,7 +401,7 @@
double d0 = this.player.locX; double d0 = this.player.locX;
double d1 = this.player.locY; double d1 = this.player.locY;
double d2 = this.player.locZ; double d2 = this.player.locZ;
@@ -639,15 +859,33 @@ @@ -640,15 +860,33 @@
++this.receivedMovePackets; ++this.receivedMovePackets;
int i = this.receivedMovePackets - this.processedMovePackets; int i = this.receivedMovePackets - this.processedMovePackets;
@ -437,7 +437,7 @@
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9); PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9);
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch); this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
return; return;
@@ -693,6 +931,69 @@ @@ -694,6 +932,69 @@
} }
} }
@ -507,7 +507,7 @@
this.B = d12 >= -0.03125D && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR && !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isGliding() && !worldserver.a(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.B = d12 >= -0.03125D && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR && !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isGliding() && !worldserver.a(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
this.player.onGround = packetplayinflying.b(); this.player.onGround = packetplayinflying.b();
this.player.getWorldServer().getChunkProvider().movePlayer(this.player); this.player.getWorldServer().getChunkProvider().movePlayer(this.player);
@@ -712,10 +1013,66 @@ @@ -713,10 +1014,66 @@
} }
public void a(double d0, double d1, double d2, float f, float f1) { public void a(double d0, double d1, double d2, float f, float f1) {
@ -575,7 +575,7 @@
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D; double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D;
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D; double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D;
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D; double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D;
@@ -727,6 +1084,14 @@ @@ -728,6 +1085,14 @@
this.teleportAwait = 0; this.teleportAwait = 0;
} }
@ -590,15 +590,15 @@
this.A = this.e; this.A = this.e;
this.player.setLocation(d0, d1, d2, f, f1); this.player.setLocation(d0, d1, d2, f, f1);
this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait)); this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait));
@@ -735,6 +1100,7 @@ @@ -736,6 +1101,7 @@
@Override @Override
public void a(PacketPlayInBlockDig packetplayinblockdig) { public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer());
+ if (this.player.isFrozen()) return; // CraftBukkit + if (this.player.isFrozen()) return; // CraftBukkit
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.b(); BlockPosition blockposition = packetplayinblockdig.b();
@@ -744,13 +1110,45 @@ this.player.resetIdleTimer();
@@ -746,13 +1112,45 @@
if (!this.player.isSpectator()) { if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND); ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@ -646,29 +646,7 @@
this.player.n(false); this.player.n(false);
} }
@@ -781,7 +1179,15 @@ @@ -779,6 +1177,7 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.c());
} else {
+ // CraftBukkit start - fire PlayerInteractEvent
+ CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, blockposition, packetplayinblockdig.c(), this.player.inventory.getItemInHand(), EnumHand.MAIN_HAND);
this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(worldserver, blockposition));
+ // Update any tile entity data for this block
+ TileEntity tileentity = worldserver.getTileEntity(blockposition);
+ if (tileentity != null) {
+ this.player.playerConnection.sendPacket(tileentity.getUpdatePacket());
+ }
+ // CraftBukkit end
}
} else {
if (packetplayinblockdig.d() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -800,11 +1206,13 @@
default:
throw new IllegalArgumentException("Invalid player action");
}
+ // CraftBukkit end
}
@Override @Override
public void a(PacketPlayInUseItem packetplayinuseitem) { public void a(PacketPlayInUseItem packetplayinuseitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseitem, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinuseitem, this, this.player.getWorldServer());
@ -676,10 +654,10 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.b(); EnumHand enumhand = packetplayinuseitem.b();
ItemStack itemstack = this.player.b(enumhand); ItemStack itemstack = this.player.b(enumhand);
@@ -818,6 +1226,14 @@ @@ -792,6 +1191,14 @@
this.player.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, ChatMessageType.GAME_INFO)); this.player.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, ChatMessageType.GAME_INFO));
} else if (this.teleportPos == null && this.player.e((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) { } else if (this.teleportPos == null && this.player.e((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
+ // CraftBukkit start - Check if we can actually do something over this large a distance + // CraftBukkit start - Check if we can actually do something over this large a distance
+ Location eyeLoc = this.getPlayer().getEyeLocation(); + Location eyeLoc = this.getPlayer().getEyeLocation();
+ double reachDistance = NumberConversions.square(eyeLoc.getX() - blockposition.getX()) + NumberConversions.square(eyeLoc.getY() - blockposition.getY()) + NumberConversions.square(eyeLoc.getZ() - blockposition.getZ()); + double reachDistance = NumberConversions.square(eyeLoc.getX() - blockposition.getX()) + NumberConversions.square(eyeLoc.getY() - blockposition.getY()) + NumberConversions.square(eyeLoc.getZ() - blockposition.getZ());
@ -691,7 +669,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock); this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
} }
@@ -828,13 +1244,53 @@ @@ -802,13 +1209,53 @@
@Override @Override
public void a(PacketPlayInBlockPlace packetplayinblockplace) { public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer());
@ -746,7 +724,7 @@
} }
} }
@@ -849,7 +1305,7 @@ @@ -823,7 +1270,7 @@
Entity entity = packetplayinspectate.a(worldserver); Entity entity = packetplayinspectate.a(worldserver);
if (entity != null) { if (entity != null) {
@ -755,7 +733,7 @@
return; return;
} }
} }
@@ -858,7 +1314,12 @@ @@ -832,7 +1279,12 @@
} }
@Override @Override
@ -769,7 +747,7 @@
@Override @Override
public void a(PacketPlayInBoatMove packetplayinboatmove) { public void a(PacketPlayInBoatMove packetplayinboatmove) {
@@ -873,11 +1334,26 @@ @@ -847,11 +1299,26 @@
@Override @Override
public void a(IChatBaseComponent ichatbasecomponent) { public void a(IChatBaseComponent ichatbasecomponent) {
@ -797,7 +775,7 @@
if (this.isExemptPlayer()) { if (this.isExemptPlayer()) {
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out"); PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
this.minecraftServer.safeShutdown(false); this.minecraftServer.safeShutdown(false);
@@ -903,6 +1379,15 @@ @@ -877,6 +1344,15 @@
} }
} }
@ -813,7 +791,7 @@
try { try {
this.networkManager.sendPacket(packet, genericfuturelistener); this.networkManager.sendPacket(packet, genericfuturelistener);
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -919,18 +1404,38 @@ @@ -893,18 +1369,38 @@
@Override @Override
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) { public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer());
@ -854,7 +832,7 @@
this.sendPacket(new PacketPlayOutChat((new ChatMessage("chat.cannotSend", new Object[0])).a(EnumChatFormat.RED))); this.sendPacket(new PacketPlayOutChat((new ChatMessage("chat.cannotSend", new Object[0])).a(EnumChatFormat.RED)));
} else { } else {
this.player.resetIdleTimer(); this.player.resetIdleTimer();
@@ -940,41 +1445,257 @@ @@ -914,41 +1410,257 @@
for (int i = 0; i < s.length(); ++i) { for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@ -1119,7 +1097,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
IJumpable ijumpable; IJumpable ijumpable;
@@ -1038,6 +1759,7 @@ @@ -1012,6 +1724,7 @@
@Override @Override
public void a(PacketPlayInUseEntity packetplayinuseentity) { public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer());
@ -1127,7 +1105,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver); Entity entity = packetplayinuseentity.a((World) worldserver);
@@ -1053,20 +1775,74 @@ @@ -1027,20 +1740,74 @@
if (this.player.h(entity) < d0) { if (this.player.h(entity) < d0) {
EnumHand enumhand; EnumHand enumhand;
@ -1203,7 +1181,7 @@
} }
} }
} }
@@ -1106,15 +1882,21 @@ @@ -1080,15 +1847,21 @@
@Override @Override
public void a(PacketPlayInCloseWindow packetplayinclosewindow) { public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
@ -1227,7 +1205,7 @@
NonNullList<ItemStack> nonnulllist = NonNullList.a(); NonNullList<ItemStack> nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) { for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) {
@@ -1123,8 +1905,274 @@ @@ -1097,8 +1870,274 @@
this.player.a(this.player.activeContainer, nonnulllist); this.player.a(this.player.activeContainer, nonnulllist);
} else { } else {
@ -1503,7 +1481,7 @@
if (ItemStack.matches(packetplayinwindowclick.f(), itemstack)) { if (ItemStack.matches(packetplayinwindowclick.f(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.b(), packetplayinwindowclick.e(), true)); this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.b(), packetplayinwindowclick.e(), true));
this.player.e = true; this.player.e = true;
@@ -1164,6 +2212,7 @@ @@ -1138,6 +2177,7 @@
@Override @Override
public void a(PacketPlayInEnchantItem packetplayinenchantitem) { public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer());
@ -1511,7 +1489,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a((EntityHuman) this.player, packetplayinenchantitem.c()); this.player.activeContainer.a((EntityHuman) this.player, packetplayinenchantitem.c());
@@ -1196,6 +2245,43 @@ @@ -1170,6 +2210,43 @@
boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45; boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45;
boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty(); boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
@ -1555,7 +1533,7 @@
if (flag1 && flag2) { if (flag1 && flag2) {
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
@@ -1221,6 +2307,7 @@ @@ -1195,6 +2272,7 @@
@Override @Override
public void a(PacketPlayInTransaction packetplayintransaction) { public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.getWorldServer());
@ -1563,7 +1541,7 @@
int i = this.player.activeContainer.windowId; int i = this.player.activeContainer.windowId;
if (i == packetplayintransaction.b() && this.k.getOrDefault(i, (short) (packetplayintransaction.c() + 1)) == packetplayintransaction.c() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { if (i == packetplayintransaction.b() && this.k.getOrDefault(i, (short) (packetplayintransaction.c() + 1)) == packetplayintransaction.c() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
@@ -1232,6 +2319,7 @@ @@ -1206,6 +2284,7 @@
@Override @Override
public void a(PacketPlayInUpdateSign packetplayinupdatesign) { public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.getWorldServer());
@ -1571,7 +1549,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.b(); BlockPosition blockposition = packetplayinupdatesign.b();
@@ -1248,14 +2336,30 @@ @@ -1222,14 +2301,30 @@
if (!tileentitysign.d() || tileentitysign.f() != this.player) { if (!tileentitysign.d() || tileentitysign.f() != this.player) {
this.minecraftServer.warning("Player " + this.player.getDisplayName().getString() + " just tried to change non-editable sign"); this.minecraftServer.warning("Player " + this.player.getDisplayName().getString() + " just tried to change non-editable sign");
@ -1603,7 +1581,7 @@
tileentitysign.update(); tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3); worldserver.notify(blockposition, iblockdata, iblockdata, 3);
@@ -1265,6 +2369,7 @@ @@ -1239,6 +2334,7 @@
@Override @Override
public void a(PacketPlayInKeepAlive packetplayinkeepalive) { public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
@ -1611,7 +1589,7 @@
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) { if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive); int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
@@ -1279,7 +2384,17 @@ @@ -1253,7 +2349,17 @@
@Override @Override
public void a(PacketPlayInAbilities packetplayinabilities) { public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer());
@ -1630,7 +1608,7 @@
} }
@Override @Override
@@ -1288,8 +2403,50 @@ @@ -1262,8 +2368,50 @@
this.player.a(packetplayinsettings); this.player.a(packetplayinsettings);
} }

Datei anzeigen

@ -1,10 +1,10 @@
--- a/net/minecraft/server/PlayerConnectionUtils.java --- a/net/minecraft/server/PlayerConnectionUtils.java
+++ b/net/minecraft/server/PlayerConnectionUtils.java +++ b/net/minecraft/server/PlayerConnectionUtils.java
@@ -9,6 +9,7 @@ @@ -14,6 +14,7 @@
public static <T extends PacketListener> void ensureMainThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException { public static <T extends PacketListener> void ensureMainThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException {
if (!iasynctaskhandler.isMainThread()) { if (!iasynctaskhandler.isMainThread()) {
iasynctaskhandler.execute(() -> { iasynctaskhandler.execute(() -> {
+ if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590 + if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590
if (t0.a().isConnected()) {
packet.a(t0); packet.a(t0);
}); } else {
throw CancelledPacketHandleException.INSTANCE;

Datei anzeigen

@ -1,8 +1,9 @@
--- a/net/minecraft/server/PlayerInteractManager.java --- a/net/minecraft/server/PlayerInteractManager.java
+++ b/net/minecraft/server/PlayerInteractManager.java +++ b/net/minecraft/server/PlayerInteractManager.java
@@ -1,5 +1,15 @@ @@ -2,6 +2,15 @@
package net.minecraft.server;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import java.util.ArrayList; +import java.util.ArrayList;
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
@ -12,11 +13,10 @@
+import org.bukkit.event.block.Action; +import org.bukkit.event.block.Action;
+import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerInteractEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class PlayerInteractManager { public class PlayerInteractManager {
public WorldServer world; @@ -30,7 +39,7 @@
@@ -26,7 +36,7 @@
this.gamemode = enumgamemode; this.gamemode = enumgamemode;
enumgamemode.a(this.player.abilities); enumgamemode.a(this.player.abilities);
this.player.updateAbilities(); this.player.updateAbilities();
@ -25,24 +25,36 @@
this.world.everyoneSleeping(); this.world.everyoneSleeping();
} }
@@ -51,7 +61,7 @@ @@ -55,7 +64,7 @@
} }
public void a() { public void a() {
- ++this.currentTick; - ++this.currentTick;
+ this.currentTick = MinecraftServer.currentTick; // CraftBukkit; + this.currentTick = MinecraftServer.currentTick; // CraftBukkit;
float f; IBlockData iblockdata;
int i;
@@ -96,6 +106,19 @@ if (this.i) {
@@ -111,10 +120,32 @@
if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) {
if (!this.world.a((EntityHuman) this.player, blockposition)) {
+ // CraftBukkit start - fire PlayerInteractEvent
+ CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, blockposition, enumdirection, this.player.inventory.getItemInHand(), EnumHand.MAIN_HAND);
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, false));
+ // Update any tile entity data for this block
+ TileEntity tileentity = world.getTileEntity(blockposition);
+ if (tileentity != null) {
+ this.player.playerConnection.sendPacket(tileentity.getUpdatePacket());
+ }
+ // CraftBukkit end
return;
} }
public void a(BlockPosition blockposition, EnumDirection enumdirection) {
+ // CraftBukkit start + // CraftBukkit start
+ PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, blockposition, enumdirection, this.player.inventory.getItemInHand(), EnumHand.MAIN_HAND); + PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, blockposition, enumdirection, this.player.inventory.getItemInHand(), EnumHand.MAIN_HAND);
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ // Let the client know the block still exists + // Let the client know the block still exists
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, false));
+ // Update any tile entity data for this block + // Update any tile entity data for this block
+ TileEntity tileentity = this.world.getTileEntity(blockposition); + TileEntity tileentity = this.world.getTileEntity(blockposition);
+ if (tileentity != null) { + if (tileentity != null) {
@ -51,19 +63,20 @@
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+
if (this.isCreative()) { if (this.isCreative()) {
if (!this.world.douseFire((EntityHuman) null, blockposition, enumdirection)) { if (!this.world.douseFire((EntityHuman) null, blockposition, enumdirection)) {
this.breakBlock(blockposition); this.a(blockposition, packetplayinblockdig_enumplayerdigtype);
@@ -122,15 +145,49 @@ @@ -130,16 +161,50 @@
} return;
} }
- this.world.douseFire((EntityHuman) null, blockposition, enumdirection); - this.world.douseFire((EntityHuman) null, blockposition, enumdirection);
+ // this.world.douseFire((EntityHuman) null, blockposition, enumdirection); // CraftBukkit - Moved down + // this.world.douseFire((EntityHuman) null, blockposition, enumdirection); // CraftBukkit - Moved down
this.lastDigTick = this.currentTick; this.lastDigTick = this.currentTick;
float f = 1.0F; float f = 1.0F;
IBlockData iblockdata = this.world.getType(blockposition);
iblockdata = this.world.getType(blockposition);
- if (!iblockdata.isAir()) { - if (!iblockdata.isAir()) {
+ // CraftBukkit start - Swings at air do *NOT* exist. + // CraftBukkit start - Swings at air do *NOT* exist.
+ if (event.useInteractedBlock() == Event.Result.DENY) { + if (event.useInteractedBlock() == Event.Result.DENY) {
@ -72,22 +85,22 @@
+ if (data.getBlock() instanceof BlockDoor) { + if (data.getBlock() instanceof BlockDoor) {
+ // For some reason *BOTH* the bottom/top part have to be marked updated. + // For some reason *BOTH* the bottom/top part have to be marked updated.
+ boolean bottom = data.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER; + boolean bottom = data.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER;
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, false));
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, bottom ? blockposition.up() : blockposition.down())); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, bottom ? blockposition.up() : blockposition.down()));
+ } else if (data.getBlock() instanceof BlockTrapdoor) { + } else if (data.getBlock() instanceof BlockTrapdoor) {
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, false));
+ } + }
+ } else if (!iblockdata.isAir()) { + } else if (!iblockdata.isAir()) {
iblockdata.attack(this.world, blockposition, this.player); iblockdata.attack(this.world, blockposition, this.player);
f = iblockdata.getDamage(this.player, this.player.world, blockposition); f = iblockdata.getDamage(this.player, this.player.world, blockposition);
+ // Allow fire punching to be blocked + // Allow fire punching to be blocked
+ this.world.douseFire((EntityHuman) null, blockposition, enumdirection); + this.world.douseFire((EntityHuman) null, blockposition, enumdirection);
+ } }
+
+ if (event.useItemInHand() == Event.Result.DENY) { + if (event.useItemInHand() == Event.Result.DENY) {
+ // If we 'insta destroyed' then the client needs to be informed. + // If we 'insta destroyed' then the client needs to be informed.
+ if (f > 1.0f) { + if (f > 1.0f) {
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, false));
+ } + }
+ return; + return;
+ } + }
@ -95,37 +108,19 @@
+ +
+ if (blockEvent.isCancelled()) { + if (blockEvent.isCancelled()) {
+ // Let the client know the block still exists + // Let the client know the block still exists
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, false));
+ return; + return;
+ } + }
+ +
+ if (blockEvent.getInstaBreak()) { + if (blockEvent.getInstaBreak()) {
+ f = 2.0f; + f = 2.0f;
} + }
+ // CraftBukkit end + // CraftBukkit end
+
if (!iblockdata.isAir() && f >= 1.0F) { if (!iblockdata.isAir() && f >= 1.0F) {
this.breakBlock(blockposition); this.a(blockposition, packetplayinblockdig_enumplayerdigtype);
@@ -149,6 +206,7 @@ } else {
@@ -196,10 +261,66 @@
public void a(BlockPosition blockposition) {
if (blockposition.equals(this.f)) {
+ this.currentTick = MinecraftServer.currentTick; // CraftBukkit
int i = this.currentTick - this.lastDigTick;
IBlockData iblockdata = this.world.getType(blockposition);
@@ -166,6 +224,10 @@
this.j = this.lastDigTick;
}
}
+ // CraftBukkit start - Force block reset to client
+ } else {
+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
+ // CraftBukkit end
}
}
@@ -190,10 +252,66 @@
public boolean breakBlock(BlockPosition blockposition) { public boolean breakBlock(BlockPosition blockposition) {
IBlockData iblockdata = this.world.getType(blockposition); IBlockData iblockdata = this.world.getType(blockposition);
@ -142,7 +137,7 @@
+ if (world.getTileEntity(blockposition) == null && !isSwordNoBreak) { + if (world.getTileEntity(blockposition) == null && !isSwordNoBreak) {
+ PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(this.world, blockposition); + PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(this.world, blockposition);
+ packet.block = Blocks.AIR.getBlockData(); + packet.block = Blocks.AIR.getBlockData();
+ ((EntityPlayer) this.player).playerConnection.sendPacket(packet); + this.player.playerConnection.sendPacket(packet);
+ } + }
+ +
+ event = new BlockBreakEvent(bblock, this.player.getBukkitEntity()); + event = new BlockBreakEvent(bblock, this.player.getBukkitEntity());
@ -168,11 +163,11 @@
+ return false; + return false;
+ } + }
+ // Let the client know the block still exists + // Let the client know the block still exists
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
+ +
+ // Brute force all possible updates + // Brute force all possible updates
+ for (EnumDirection dir : EnumDirection.values()) { + for (EnumDirection dir : EnumDirection.values()) {
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition.shift(dir))); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition.shift(dir)));
+ } + }
+ +
+ // Update any tile entity data for this block + // Update any tile entity data for this block
@ -193,47 +188,55 @@
TileEntity tileentity = this.world.getTileEntity(blockposition); TileEntity tileentity = this.world.getTileEntity(blockposition);
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
@@ -221,6 +339,10 @@ @@ -209,6 +330,10 @@
} } else if (this.player.a((World) this.world, blockposition, this.gamemode)) {
} return false;
} else {
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.block.BlockState state = bblock.getState(); + org.bukkit.block.BlockState state = bblock.getState();
+ world.captureDrops = new ArrayList<>(); + world.captureDrops = new ArrayList<>();
+ // CraftBukkit end + // CraftBukkit end
boolean flag = this.c(blockposition); block.a((World) this.world, blockposition, iblockdata, (EntityHuman) this.player);
boolean flag = this.world.a(blockposition, false);
if (!this.isCreative()) { @@ -217,20 +342,33 @@
@@ -228,13 +350,27 @@ }
if (this.isCreative()) {
- return true;
+ // return true; // CraftBukkit
} else {
ItemStack itemstack = this.player.getItemInMainHand();
boolean flag1 = this.player.hasBlock(iblockdata); boolean flag1 = this.player.hasBlock(iblockdata);
itemstack1.a(this.world, iblockdata, blockposition, this.player); itemstack.a(this.world, iblockdata, blockposition, this.player);
- if (flag && flag1) { - if (flag && flag1) {
+ // CraftBukkit start - Check if block should drop items + if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items
+ if (flag && flag1 && event.isDropItems()) { ItemStack itemstack1 = itemstack.isEmpty() ? ItemStack.a : itemstack.cloneItemStack();
ItemStack itemstack2 = itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack();
iblockdata.getBlock().a(this.world, this.player, blockposition, iblockdata, tileentity, itemstack2); block.a(this.world, this.player, blockposition, iblockdata, tileentity, itemstack1);
}
+ // CraftBukkit end
} }
- return true;
+ // return true; // CraftBukkit
+ }
+ // CraftBukkit start
+ if (event.isDropItems()) { + if (event.isDropItems()) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockDropItemEvent(bblock, state, this.player, world.captureDrops); + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockDropItemEvent(bblock, state, this.player, world.captureDrops);
+ } + }
+ world.captureDrops = null; + world.captureDrops = null;
+ // CraftBukkit end
+ +
+ // CraftBukkit start - Drop event experience + // Drop event experience
+ if (flag && event != null) { + if (flag && event != null) {
+ iblockdata.getBlock().dropExperience(this.world, blockposition, event.getExpToDrop()); + iblockdata.getBlock().dropExperience(this.world, blockposition, event.getExpToDrop());
+ } }
+ // CraftBukkit end
+ +
return flag; + return true;
+ // CraftBukkit end
} }
} }
@@ -277,12 +413,41 @@ }
@@ -272,12 +410,41 @@
} }
} }
@ -252,7 +255,7 @@
+ cancelledBlock = !(itileinventory instanceof ITileInventory); + cancelledBlock = !(itileinventory instanceof ITileInventory);
+ } + }
+ +
+ if (entityhuman.getCooldownTracker().a(itemstack.getItem())) { + if (entityhuman.getCooldownTracker().hasCooldown(itemstack.getItem())) {
+ cancelledBlock = true; + cancelledBlock = true;
+ } + }
+ +
@ -275,13 +278,13 @@
if (itileinventory != null) { if (itileinventory != null) {
entityhuman.openContainer(itileinventory); entityhuman.openContainer(itileinventory);
@@ -294,24 +459,26 @@ @@ -289,24 +456,26 @@
boolean flag = !entityhuman.getItemInMainHand().isEmpty() || !entityhuman.getItemInOffHand().isEmpty(); boolean flag = !entityhuman.getItemInMainHand().isEmpty() || !entityhuman.getItemInOffHand().isEmpty();
boolean flag1 = entityhuman.isSneaking() && flag; boolean flag1 = entityhuman.isSneaking() && flag;
- if (!flag1 && iblockdata.interact(world, entityhuman, enumhand, movingobjectpositionblock)) { - if (!flag1 && iblockdata.interact(world, entityhuman, enumhand, movingobjectpositionblock)) {
- return EnumInteractionResult.SUCCESS; - return EnumInteractionResult.SUCCESS;
- } else if (!itemstack.isEmpty() && !entityhuman.getCooldownTracker().a(itemstack.getItem())) { - } else if (!itemstack.isEmpty() && !entityhuman.getCooldownTracker().hasCooldown(itemstack.getItem())) {
+ if (!flag1) { + if (!flag1) {
+ enuminteractionresult = iblockdata.interact(world, entityhuman, enumhand, movingobjectpositionblock) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.FAIL; + enuminteractionresult = iblockdata.interact(world, entityhuman, enumhand, movingobjectpositionblock) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.FAIL;
+ } + }

Datei anzeigen

@ -1,19 +0,0 @@
--- a/net/minecraft/server/Raid.java
+++ b/net/minecraft/server/Raid.java
@@ -137,14 +137,14 @@
private void y() {
Collection<EntityPlayer> collection = this.r.getPlayers();
Set<EntityPlayer> set = Sets.newHashSet(collection);
- Iterator iterator = collection.iterator();
+ Iterator iterator = set.iterator(); // CraftBukkit
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
BlockPosition blockposition = new BlockPosition(entityplayer);
if (this.k.c_(blockposition) != this) {
- set.remove(entityplayer);
+ iterator.remove(); // CraftBukkit
this.r.removePlayer(entityplayer);
}
}

Datei anzeigen

@ -11,9 +11,9 @@
public final class SpawnerCreature { public final class SpawnerCreature {
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
@@ -85,9 +89,12 @@ @@ -88,9 +92,12 @@
entityinsentient.setPositionRotation((double) f, (double) k, (double) f1, world.random.nextFloat() * 360.0F, 0.0F); entityinsentient.setPositionRotation((double) f, (double) k, (double) f1, world.random.nextFloat() * 360.0F, 0.0F);
if ((entityhuman.e((double) f, (double) k, (double) f1) <= 16384.0D || !entityinsentient.isTypeNotPersistent(entityhuman.e((double) f, (double) k, (double) f1))) && entityinsentient.a((GeneratorAccess) world, EnumMobSpawn.NATURAL) && entityinsentient.a((IWorldReader) world)) { if ((d0 <= 16384.0D || !entityinsentient.isTypeNotPersistent(d0)) && entityinsentient.a((GeneratorAccess) world, EnumMobSpawn.NATURAL) && entityinsentient.a((IWorldReader) world)) {
groupdataentity = entityinsentient.prepare(world, world.getDamageScaler(new BlockPosition(entityinsentient)), EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null); groupdataentity = entityinsentient.prepare(world, world.getDamageScaler(new BlockPosition(entityinsentient)), EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
- ++i; - ++i;
- ++i2; - ++i2;
@ -24,10 +24,10 @@
+ ++i2; + ++i2;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (i >= entityinsentient.dD()) { if (i >= entityinsentient.dC()) {
return; return;
} }
@@ -212,7 +219,7 @@ @@ -216,7 +223,7 @@
if (entityinsentient.a(generatoraccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.a((IWorldReader) generatoraccess)) { if (entityinsentient.a(generatoraccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.a((IWorldReader) generatoraccess)) {
groupdataentity = entityinsentient.prepare(generatoraccess, generatoraccess.getDamageScaler(new BlockPosition(entityinsentient)), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, (NBTTagCompound) null); groupdataentity = entityinsentient.prepare(generatoraccess, generatoraccess.getDamageScaler(new BlockPosition(entityinsentient)), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, (NBTTagCompound) null);

Datei anzeigen

@ -1,23 +1,23 @@
--- a/net/minecraft/server/TagRegistry.java --- a/net/minecraft/server/TagRegistry.java
+++ b/net/minecraft/server/TagRegistry.java +++ b/net/minecraft/server/TagRegistry.java
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
CompletableFuture<Map<MinecraftKey, Tag.a<Item>>> completablefuture1 = this.b.a(iresourcemanager, executor); CompletableFuture<Map<MinecraftKey, Tag.a<Item>>> completablefuture1 = this.itemTags.a(iresourcemanager, executor);
CompletableFuture<Map<MinecraftKey, Tag.a<FluidType>>> completablefuture2 = this.c.a(iresourcemanager, executor); CompletableFuture<Map<MinecraftKey, Tag.a<FluidType>>> completablefuture2 = this.fluidTags.a(iresourcemanager, executor);
CompletableFuture<Map<MinecraftKey, Tag.a<EntityTypes<?>>>> completablefuture3 = this.d.a(iresourcemanager, executor); CompletableFuture<Map<MinecraftKey, Tag.a<EntityTypes<?>>>> completablefuture3 = this.entityTags.a(iresourcemanager, executor);
- CompletableFuture completablefuture4 = completablefuture.thenCombine(completablefuture1, Pair::of).thenCombine(completablefuture2.thenCombine(completablefuture3, Pair::of), (pair, pair1) -> { - CompletableFuture completablefuture4 = completablefuture.thenCombine(completablefuture1, Pair::of).thenCombine(completablefuture2.thenCombine(completablefuture3, Pair::of), (pair, pair1) -> {
+ CompletableFuture<TagRegistry.a> completablefuture4 = completablefuture.thenCombine(completablefuture1, Pair::of).thenCombine(completablefuture2.thenCombine(completablefuture3, Pair::of), (pair, pair1) -> { // CraftBukkit - decompile error + CompletableFuture<TagRegistry.a> completablefuture4 = completablefuture.thenCombine(completablefuture1, Pair::of).thenCombine(completablefuture2.thenCombine(completablefuture3, Pair::of), (pair, pair1) -> { // CraftBukkit - decompile error
return new TagRegistry.a((Map) pair.getFirst(), (Map) pair.getSecond(), (Map) pair1.getFirst(), (Map) pair1.getSecond()); return new TagRegistry.a((Map) pair.getFirst(), (Map) pair.getSecond(), (Map) pair1.getFirst(), (Map) pair1.getSecond());
}); });
@@ -72,6 +72,12 @@ @@ -72,6 +72,12 @@
TagsItem.a((Tags) this.b); TagsItem.a((Tags) this.itemTags);
TagsFluid.a((Tags) this.c); TagsFluid.a((Tags) this.fluidTags);
TagsEntity.a((Tags) this.d); TagsEntity.a((Tags) this.entityTags);
+ // CraftBukkit start + // CraftBukkit start
+ this.a.version++; + this.blockTags.version++;
+ this.b.version++; + this.itemTags.version++;
+ this.c.version++; + this.fluidTags.version++;
+ this.d.version++; + this.entityTags.version++;
+ // CraftBukkit end + // CraftBukkit end
}, executor1); }, executor1);
} }

Datei anzeigen

@ -1,7 +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
@@ -39,11 +39,17 @@ @@ -39,11 +39,17 @@
public void a() { public void b() {
int i = this.nextTickList.size(); int i = this.nextTickList.size();
- if (i != this.nextTickListHash.size()) { - if (i != this.nextTickListHash.size()) {

Datei anzeigen

@ -1,20 +0,0 @@
--- a/net/minecraft/server/Ticket.java
+++ b/net/minecraft/server/Ticket.java
@@ -6,7 +6,7 @@
private final TicketType<T> a;
private final int b;
- private final T c;
+ public final T c; // CraftBukkit - private -> public // PAIL identifier
private final long d;
protected Ticket(TicketType<T> tickettype, int i, T t0, long j) {
@@ -24,7 +24,7 @@
} else {
int j = Integer.compare(System.identityHashCode(this.a), System.identityHashCode(ticket.a));
- return j != 0 ? j : this.a.a().compare(this.c, ticket.c);
+ return j != 0 ? j : this.a.a().compare(this.c, (T) ticket.c); // CraftBukkit - decompile error
}
}

Datei anzeigen

@ -1,14 +1,5 @@
--- a/net/minecraft/server/TicketType.java --- a/net/minecraft/server/TicketType.java
+++ b/net/minecraft/server/TicketType.java +++ b/net/minecraft/server/TicketType.java
@@ -6,7 +6,7 @@
private final String i;
private final Comparator<T> j;
- private final long k;
+ private long k; // PAIL
public static final TicketType<Unit> START = a("start", (unit, unit1) -> {
return 0;
});
@@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
public static final TicketType<BlockPosition2D> PORTAL = a("portal", Comparator.comparingLong(BlockPosition2D::b)); public static final TicketType<BlockPosition2D> PORTAL = a("portal", Comparator.comparingLong(BlockPosition2D::b));
public static final TicketType<Integer> POST_TELEPORT = a("post_teleport", Integer::compareTo, 5); public static final TicketType<Integer> POST_TELEPORT = a("post_teleport", Integer::compareTo, 5);
@ -18,14 +9,3 @@
public static <T> TicketType<T> a(String s, Comparator<T> comparator) { public static <T> TicketType<T> a(String s, Comparator<T> comparator) {
return new TicketType<>(s, comparator, 0L); return new TicketType<>(s, comparator, 0L);
@@ -45,4 +47,10 @@
public long b() {
return this.k;
}
+
+ // CraftBukkit start
+ public void setLoadPeriod(int ticks) {
+ this.k = ticks;
+ }
+ // CraftBukkit end
}

Datei anzeigen

@ -30,7 +30,7 @@
public TileEntityBeacon() { public TileEntityBeacon() {
super(TileEntityTypes.BEACON); super(TileEntityTypes.BEACON);
@@ -192,39 +208,78 @@ @@ -194,39 +210,78 @@
super.V_(); super.V_();
} }
@ -117,9 +117,9 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
public void a(SoundEffect soundeffect) { public void a(SoundEffect soundeffect) {
this.world.a((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F); this.world.playSound((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
} }
@@ -254,8 +309,11 @@ @@ -256,8 +311,11 @@
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
super.load(nbttagcompound); super.load(nbttagcompound);

Datei anzeigen

@ -33,12 +33,12 @@
} }
if (this.target != null) { if (this.target != null) {
- this.world.a((EntityHuman) null, this.target.locX, this.target.locY, this.target.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F); - this.world.playSound((EntityHuman) null, this.target.locX, this.target.locY, this.target.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F);
- this.target.damageEntity(DamageSource.MAGIC, 4.0F); - this.target.damageEntity(DamageSource.MAGIC, 4.0F);
+ // CraftBukkit start + // CraftBukkit start
+ CraftEventFactory.blockDamage = CraftBlock.at(this.world, this.position); + CraftEventFactory.blockDamage = CraftBlock.at(this.world, this.position);
+ if (this.target.damageEntity(DamageSource.MAGIC, 4.0F)) { + if (this.target.damageEntity(DamageSource.MAGIC, 4.0F)) {
+ this.world.a((EntityHuman) null, this.target.locX, this.target.locY, this.target.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F); + this.world.playSound((EntityHuman) null, this.target.locX, this.target.locY, this.target.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F);
+ } + }
+ CraftEventFactory.blockDamage = null; + CraftEventFactory.blockDamage = null;
+ // CraftBukkit end + // CraftBukkit end

Datei anzeigen

@ -130,7 +130,7 @@
} }
@Override @Override
@@ -206,7 +293,7 @@ @@ -211,7 +298,7 @@
@Override @Override
public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) { public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {

Datei anzeigen

@ -1,11 +1,11 @@
--- a/net/minecraft/server/VillageSiege.java --- a/net/minecraft/server/VillageSiege.java
+++ b/net/minecraft/server/VillageSiege.java +++ b/net/minecraft/server/VillageSiege.java
@@ -101,7 +101,7 @@ @@ -104,7 +104,7 @@
} }
entityzombie.setPositionRotation(vec3d.x, vec3d.y, vec3d.z, this.a.random.nextFloat() * 360.0F, 0.0F); entityzombie.setPositionRotation(vec3d.x, vec3d.y, vec3d.z, worldserver.random.nextFloat() * 360.0F, 0.0F);
- this.a.addEntity(entityzombie); - worldserver.addEntity(entityzombie);
+ this.a.addEntity(entityzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_INVASION); // CraftBukkit + worldserver.addEntity(entityzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_INVASION); // CraftBukkit
} }
} }

Datei anzeigen

@ -171,7 +171,7 @@
+ /* + /*
if (iblockdata2 == iblockdata) { if (iblockdata2 == iblockdata) {
if (iblockdata1 != iblockdata2) { if (iblockdata1 != iblockdata2) {
this.m(blockposition); this.b(blockposition, iblockdata1, iblockdata2);
@@ -165,12 +289,65 @@ @@ -165,12 +289,65 @@
this.a(blockposition, iblockdata1, iblockdata2); this.a(blockposition, iblockdata1, iblockdata2);
@ -197,7 +197,7 @@
+ IBlockData iblockdata2 = actualBlock; + IBlockData iblockdata2 = actualBlock;
+ if (iblockdata2 == iblockdata) { + if (iblockdata2 == iblockdata) {
+ if (iblockdata1 != iblockdata2) { + if (iblockdata1 != iblockdata2) {
+ this.m(blockposition); + this.b(blockposition, iblockdata1, iblockdata2);
+ } + }
+ +
+ if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || (chunk.getState() != null && chunk.getState().isAtLeast(PlayerChunk.State.TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement + if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || (chunk.getState() != null && chunk.getState().isAtLeast(PlayerChunk.State.TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/WorldServer.java --- a/net/minecraft/server/WorldServer.java
+++ b/net/minecraft/server/WorldServer.java +++ b/net/minecraft/server/WorldServer.java
@@ -30,6 +30,15 @@ @@ -34,6 +34,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;
@ -16,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();
@@ -55,12 +64,29 @@ @@ -58,12 +67,29 @@
@Nullable @Nullable
private final MobSpawnerTrader mobSpawnerTrader; private final MobSpawnerTrader mobSpawnerTrader;
@ -49,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);
@@ -83,7 +109,8 @@ @@ -85,7 +111,8 @@
this.getWorldData().setGameType(minecraftserver.getGamemode()); this.getWorldData().setGameType(minecraftserver.getGamemode());
} }
@ -59,7 +59,7 @@
} }
public void doTick(BooleanSupplier booleansupplier) { public void doTick(BooleanSupplier booleansupplier) {
@@ -160,6 +187,7 @@ @@ -162,6 +189,7 @@
this.rainLevel = MathHelper.a(this.rainLevel, 0.0F, 1.0F); this.rainLevel = MathHelper.a(this.rainLevel, 0.0F, 1.0F);
} }
@ -67,7 +67,7 @@
if (this.lastRainLevel != this.rainLevel) { if (this.lastRainLevel != this.rainLevel) {
this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.rainLevel)), this.worldProvider.getDimensionManager()); this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.rainLevel)), this.worldProvider.getDimensionManager());
} }
@@ -178,13 +206,34 @@ @@ -180,13 +208,34 @@
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.rainLevel)); this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.rainLevel));
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.thunderLevel)); this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.thunderLevel));
} }
@ -97,11 +97,11 @@
this.getWorldData().setDifficulty(EnumDifficulty.HARD); this.getWorldData().setDifficulty(EnumDifficulty.HARD);
} }
if (this.D && this.players.stream().noneMatch((entityplayer) -> { if (this.C && this.players.stream().noneMatch((entityplayer) -> {
- return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping(); - return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping();
+ return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit + return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit
})) { })) {
this.D = false; this.C = false;
if (this.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)) { if (this.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)) {
@@ -225,7 +274,7 @@ @@ -225,7 +274,7 @@
this.ae(); this.ae();
@ -266,25 +266,17 @@
} }
protected void k_() throws ExceptionWorldConflict { protected void k_() throws ExceptionWorldConflict {
@@ -715,8 +811,16 @@ @@ -719,7 +815,8 @@
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
while (objectiterator.hasNext()) { - if (entityinsentient.isPersistent() || entityinsentient.I()) {
Entity entity = (Entity) objectiterator.next(); + // CraftBukkit - Split out persistent check, don't apply it to special persistent mobs
+ // CraftBukkit start - Split out persistent check, don't apply it to special persistent mobs
+ if (entity instanceof EntityInsentient) {
+ EntityInsentient entityinsentient = (EntityInsentient) entity;
+ if (entityinsentient.isTypeNotPersistent(0) && entityinsentient.isPersistent()) { + if (entityinsentient.isTypeNotPersistent(0) && entityinsentient.isPersistent()) {
+ continue; continue;
+ } }
+ } }
@@ -736,11 +833,24 @@
- if (!(entity instanceof EntityInsentient) || !((EntityInsentient) entity).isPersistent()) {
+ if (true || !(entity instanceof EntityInsentient) || !((EntityInsentient) entity).isPersistent()) {
+ // CraftBukkit end
EnumCreatureType enumcreaturetype = entity.getEntityType().d();
if (enumcreaturetype != EnumCreatureType.MISC && this.getChunkProvider().b(entity)) {
@@ -730,11 +834,24 @@
@Override @Override
public boolean addEntity(Entity entity) { public boolean addEntity(Entity entity) {
@ -311,7 +303,7 @@
} }
public void addEntityTeleport(Entity entity) { public void addEntityTeleport(Entity entity) {
@@ -784,13 +901,18 @@ @@ -790,13 +900,18 @@
this.registerEntity(entityplayer); this.registerEntity(entityplayer);
} }
@ -332,7 +324,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)) {
@@ -818,7 +940,7 @@ @@ -824,7 +939,7 @@
if (entity1 == null) { if (entity1 == null) {
return false; return false;
} else { } else {
@ -341,23 +333,23 @@
return true; return true;
} }
} }
@@ -873,6 +995,7 @@ @@ -879,6 +994,7 @@
this.I.remove(((EntityInsentient) entity).getNavigation()); this.H.remove(((EntityInsentient) entity).getNavigation());
} }
+ entity.valid = false; // CraftBukkit + entity.valid = false; // CraftBukkit
} }
private void registerEntity(Entity entity) { private void registerEntity(Entity entity) {
@@ -896,6 +1019,7 @@ @@ -902,6 +1018,7 @@
if (entity instanceof EntityInsentient) { if (entity instanceof EntityInsentient) {
this.I.add(((EntityInsentient) entity).getNavigation()); this.H.add(((EntityInsentient) entity).getNavigation());
} }
+ entity.valid = true; // CraftBukkit + entity.valid = true; // CraftBukkit
} }
} }
@@ -926,6 +1050,18 @@ @@ -932,6 +1049,18 @@
} }
public void strikeLightning(EntityLightning entitylightning) { public void strikeLightning(EntityLightning entitylightning) {
@ -376,7 +368,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));
} }
@@ -934,6 +1070,12 @@ @@ -940,6 +1069,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();
@ -389,7 +381,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next(); EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -942,6 +1084,12 @@ @@ -948,6 +1083,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;
@ -402,7 +394,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));
} }
@@ -1002,6 +1150,14 @@ @@ -1008,6 +1149,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) {
@ -417,7 +409,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) {
@@ -1010,6 +1166,8 @@ @@ -1016,6 +1165,8 @@
explosion.a(); explosion.a();
explosion.a(false); explosion.a(false);
@ -426,7 +418,7 @@
if (explosion_effect == Explosion.Effect.NONE) { if (explosion_effect == Explosion.Effect.NONE) {
explosion.clearBlocks(); explosion.clearBlocks();
} }
@@ -1074,13 +1232,20 @@ @@ -1080,13 +1231,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) {
@ -449,7 +441,7 @@
++j; ++j;
} }
} }
@@ -1163,7 +1328,13 @@ @@ -1169,7 +1327,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(() -> {

Datei anzeigen

@ -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.3-R0.1-SNAPSHOT</version> <version>1.14.4-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.3</minecraft.version> <minecraft.version>1.14.4</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>
@ -56,7 +56,7 @@
<dependency> <dependency>
<groupId>org.xerial</groupId> <groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId> <artifactId>sqlite-jdbc</artifactId>
<version>3.27.2.1</version> <version>3.28.0</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>

Datei anzeigen

@ -151,7 +151,7 @@ public enum CraftParticle {
} }
public static Particle toBukkit(net.minecraft.server.ParticleParam nms) { public static Particle toBukkit(net.minecraft.server.ParticleParam nms) {
return toBukkit(nms.b()); return toBukkit(nms.getParticle());
} }
public static Particle toBukkit(net.minecraft.server.Particle nms) { public static Particle toBukkit(net.minecraft.server.Particle nms) {

Datei anzeigen

@ -306,7 +306,7 @@ public final class CraftServer implements Server {
ambientSpawn = configuration.getInt("spawn-limits.ambient"); ambientSpawn = configuration.getInt("spawn-limits.ambient");
console.autosavePeriod = configuration.getInt("ticks-per.autosave"); console.autosavePeriod = configuration.getInt("ticks-per.autosave");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
TicketType.PLUGIN.setLoadPeriod(configuration.getInt("chunk-gc.period-in-ticks")); TicketType.PLUGIN.loadPeriod = configuration.getInt("chunk-gc.period-in-ticks");
minimumAPI = configuration.getString("settings.minimum-api"); minimumAPI = configuration.getString("settings.minimum-api");
loadIcon(); loadIcon();
} }
@ -717,7 +717,7 @@ public final class CraftServer implements Server {
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
ambientSpawn = configuration.getInt("spawn-limits.ambient"); ambientSpawn = configuration.getInt("spawn-limits.ambient");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
TicketType.PLUGIN.setLoadPeriod(configuration.getInt("chunk-gc.period-in-ticks")); TicketType.PLUGIN.loadPeriod = configuration.getInt("chunk-gc.period-in-ticks");
minimumAPI = configuration.getString("settings.minimum-api"); minimumAPI = configuration.getString("settings.minimum-api");
printSaveWarning = false; printSaveWarning = false;
console.autosavePeriod = configuration.getInt("ticks-per.autosave"); console.autosavePeriod = configuration.getInt("ticks-per.autosave");
@ -1826,11 +1826,11 @@ public final class CraftServer implements Server {
case org.bukkit.Tag.REGISTRY_BLOCKS: case org.bukkit.Tag.REGISTRY_BLOCKS:
Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Block namespace must have material type"); Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Block namespace must have material type");
return (org.bukkit.Tag<T>) new CraftBlockTag(console.getTagRegistry().a(), key); return (org.bukkit.Tag<T>) new CraftBlockTag(console.getTagRegistry().getBlockTags(), key);
case org.bukkit.Tag.REGISTRY_ITEMS: case org.bukkit.Tag.REGISTRY_ITEMS:
Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Item namespace must have material type"); Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Item namespace must have material type");
return (org.bukkit.Tag<T>) new CraftItemTag(console.getTagRegistry().b(), key); return (org.bukkit.Tag<T>) new CraftItemTag(console.getTagRegistry().getItemTags(), key);
default: default:
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
@ -1843,12 +1843,12 @@ public final class CraftServer implements Server {
case org.bukkit.Tag.REGISTRY_BLOCKS: case org.bukkit.Tag.REGISTRY_BLOCKS:
Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Block namespace must have material type"); Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Block namespace must have material type");
TagsServer<Block> blockTags = console.getTagRegistry().a(); // PAIL: getBlockTags TagsServer<Block> blockTags = console.getTagRegistry().getBlockTags();
return blockTags.b().keySet().stream().map(key -> (org.bukkit.Tag<T>) new CraftBlockTag(blockTags, key)).collect(ImmutableList.toImmutableList()); return blockTags.b().keySet().stream().map(key -> (org.bukkit.Tag<T>) new CraftBlockTag(blockTags, key)).collect(ImmutableList.toImmutableList());
case org.bukkit.Tag.REGISTRY_ITEMS: case org.bukkit.Tag.REGISTRY_ITEMS:
Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Item namespace must have material type"); Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Item namespace must have material type");
TagsServer<Item> itemTags = console.getTagRegistry().b(); // PAIL: getItemTags TagsServer<Item> itemTags = console.getTagRegistry().getItemTags();
return itemTags.b().keySet().stream().map(key -> (org.bukkit.Tag<T>) new CraftItemTag(itemTags, key)).collect(ImmutableList.toImmutableList()); return itemTags.b().keySet().stream().map(key -> (org.bukkit.Tag<T>) new CraftItemTag(itemTags, key)).collect(ImmutableList.toImmutableList());
default: default:
throw new IllegalArgumentException(); throw new IllegalArgumentException();

Datei anzeigen

@ -113,8 +113,8 @@ public enum CraftStatistic {
} }
public static org.bukkit.Statistic getBukkitStatistic(net.minecraft.server.Statistic<?> statistic) { public static org.bukkit.Statistic getBukkitStatistic(net.minecraft.server.Statistic<?> statistic) {
IRegistry statRegistry = statistic.a().a(); IRegistry statRegistry = statistic.getWrapper().getRegistry();
MinecraftKey nmsKey = IRegistry.STATS.getKey(statistic.a()); MinecraftKey nmsKey = IRegistry.STATS.getKey(statistic.getWrapper());
if (statRegistry == IRegistry.CUSTOM_STAT) { if (statRegistry == IRegistry.CUSTOM_STAT) {
nmsKey = (MinecraftKey) statistic.b(); nmsKey = (MinecraftKey) statistic.b();

Datei anzeigen

@ -482,7 +482,7 @@ public class CraftWorld implements World {
Preconditions.checkArgument(plugin != null, "null plugin"); Preconditions.checkArgument(plugin != null, "null plugin");
Preconditions.checkArgument(plugin.isEnabled(), "plugin is not enabled"); Preconditions.checkArgument(plugin.isEnabled(), "plugin is not enabled");
ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.u; ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.chunkDistanceManager;
if (chunkDistanceManager.addTicketAtLevel(TicketType.PLUGIN_TICKET, new ChunkCoordIntPair(x, z), 31, plugin)) { // keep in-line with force loading, add at level 31 if (chunkDistanceManager.addTicketAtLevel(TicketType.PLUGIN_TICKET, new ChunkCoordIntPair(x, z), 31, plugin)) { // keep in-line with force loading, add at level 31
this.getChunkAt(x, z); // ensure loaded this.getChunkAt(x, z); // ensure loaded
@ -496,7 +496,7 @@ public class CraftWorld implements World {
public boolean removePluginChunkTicket(int x, int z, Plugin plugin) { public boolean removePluginChunkTicket(int x, int z, Plugin plugin) {
Preconditions.checkNotNull(plugin, "null plugin"); Preconditions.checkNotNull(plugin, "null plugin");
ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.u; ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.chunkDistanceManager;
return chunkDistanceManager.removeTicketAtLevel(TicketType.PLUGIN_TICKET, new ChunkCoordIntPair(x, z), 31, plugin); // keep in-line with force loading, remove at level 31 return chunkDistanceManager.removeTicketAtLevel(TicketType.PLUGIN_TICKET, new ChunkCoordIntPair(x, z), 31, plugin); // keep in-line with force loading, remove at level 31
} }
@ -504,13 +504,13 @@ public class CraftWorld implements World {
public void removePluginChunkTickets(Plugin plugin) { public void removePluginChunkTickets(Plugin plugin) {
Preconditions.checkNotNull(plugin, "null plugin"); Preconditions.checkNotNull(plugin, "null plugin");
ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.u; ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.chunkDistanceManager;
chunkDistanceManager.removeAllTicketsFor(TicketType.PLUGIN_TICKET, 31, plugin); // keep in-line with force loading, remove at level 31 chunkDistanceManager.removeAllTicketsFor(TicketType.PLUGIN_TICKET, 31, plugin); // keep in-line with force loading, remove at level 31
} }
@Override @Override
public Collection<Plugin> getPluginChunkTickets(int x, int z) { public Collection<Plugin> getPluginChunkTickets(int x, int z) {
ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.u; ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.chunkDistanceManager;
ObjectSortedSet<Ticket<?>> tickets = chunkDistanceManager.tickets.get(ChunkCoordIntPair.pair(x, z)); ObjectSortedSet<Ticket<?>> tickets = chunkDistanceManager.tickets.get(ChunkCoordIntPair.pair(x, z));
if (tickets == null) { if (tickets == null) {
@ -520,7 +520,7 @@ public class CraftWorld implements World {
ImmutableList.Builder<Plugin> ret = ImmutableList.builder(); ImmutableList.Builder<Plugin> ret = ImmutableList.builder();
for (Ticket<?> ticket : tickets) { for (Ticket<?> ticket : tickets) {
if (ticket.getTicketType() == TicketType.PLUGIN_TICKET) { if (ticket.getTicketType() == TicketType.PLUGIN_TICKET) {
ret.add((Plugin) ticket.c); ret.add((Plugin) ticket.identifier);
} }
} }
@ -530,7 +530,7 @@ public class CraftWorld implements World {
@Override @Override
public Map<Plugin, Collection<Chunk>> getPluginChunkTickets() { public Map<Plugin, Collection<Chunk>> getPluginChunkTickets() {
Map<Plugin, ImmutableList.Builder<Chunk>> ret = new HashMap<>(); Map<Plugin, ImmutableList.Builder<Chunk>> ret = new HashMap<>();
ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.u; ChunkMapDistance chunkDistanceManager = this.world.getChunkProvider().playerChunkMap.chunkDistanceManager;
for (Long2ObjectMap.Entry<ObjectSortedSet<Ticket<?>>> chunkTickets : chunkDistanceManager.tickets.long2ObjectEntrySet()) { for (Long2ObjectMap.Entry<ObjectSortedSet<Ticket<?>>> chunkTickets : chunkDistanceManager.tickets.long2ObjectEntrySet()) {
long chunkKey = chunkTickets.getLongKey(); long chunkKey = chunkTickets.getLongKey();
@ -546,7 +546,7 @@ public class CraftWorld implements World {
chunk = this.getChunkAt(ChunkCoordIntPair.getX(chunkKey), ChunkCoordIntPair.getZ(chunkKey)); chunk = this.getChunkAt(ChunkCoordIntPair.getX(chunkKey), ChunkCoordIntPair.getZ(chunkKey));
} }
ret.computeIfAbsent((Plugin) ticket.c, (key) -> ImmutableList.builder()).add(chunk); ret.computeIfAbsent((Plugin) ticket.identifier, (key) -> ImmutableList.builder()).add(chunk);
} }
} }
@ -1923,7 +1923,7 @@ public class CraftWorld implements World {
double y = loc.getY(); double y = loc.getY();
double z = loc.getZ(); double z = loc.getZ();
getHandle().a(null, x, y, z, CraftSound.getSoundEffect(CraftSound.getSound(sound)), SoundCategory.valueOf(category.name()), volume, pitch); // PAIL: rename getHandle().playSound(null, x, y, z, CraftSound.getSoundEffect(CraftSound.getSound(sound)), SoundCategory.valueOf(category.name()), volume, pitch);
} }
@Override @Override
@ -1992,7 +1992,7 @@ public class CraftWorld implements World {
GameRules.GameRuleValue<?> handle = getHandle().getGameRules().get(getGameRulesNMS().get(rule)); GameRules.GameRuleValue<?> handle = getHandle().getGameRules().get(getGameRulesNMS().get(rule));
handle.setValue(value); handle.setValue(value);
handle.a(getHandle().getMinecraftServer()); handle.onChange(getHandle().getMinecraftServer());
return true; return true;
} }
@ -2016,7 +2016,7 @@ public class CraftWorld implements World {
@Override @Override
public <T> T getGameRuleDefault(GameRule<T> rule) { public <T> T getGameRuleDefault(GameRule<T> rule) {
Validate.notNull(rule, "GameRule cannot be null"); Validate.notNull(rule, "GameRule cannot be null");
return convert(rule, getGameRuleDefinitions().get(rule.getName()).a()); return convert(rule, getGameRuleDefinitions().get(rule.getName()).getValue());
} }
@Override @Override
@ -2028,7 +2028,7 @@ public class CraftWorld implements World {
GameRules.GameRuleValue<?> handle = getHandle().getGameRules().get(getGameRulesNMS().get(rule.getName())); GameRules.GameRuleValue<?> handle = getHandle().getGameRules().get(getGameRulesNMS().get(rule.getName()));
handle.setValue(newValue.toString()); handle.setValue(newValue.toString());
handle.a(getHandle().getMinecraftServer()); handle.onChange(getHandle().getMinecraftServer());
return true; return true;
} }

Datei anzeigen

@ -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();

Datei anzeigen

@ -25,7 +25,7 @@ public class CraftAttributeInstance implements AttributeInstance {
@Override @Override
public double getBaseValue() { public double getBaseValue() {
return handle.b(); return handle.getBaseValue();
} }
@Override @Override
@ -36,7 +36,7 @@ public class CraftAttributeInstance implements AttributeInstance {
@Override @Override
public Collection<AttributeModifier> getModifiers() { public Collection<AttributeModifier> getModifiers() {
List<AttributeModifier> result = new ArrayList<AttributeModifier>(); List<AttributeModifier> result = new ArrayList<AttributeModifier>();
for (net.minecraft.server.AttributeModifier nms : handle.c()) { for (net.minecraft.server.AttributeModifier nms : handle.getModifiers()) {
result.add(convert(nms)); result.add(convert(nms));
} }
@ -46,13 +46,13 @@ public class CraftAttributeInstance implements AttributeInstance {
@Override @Override
public void addModifier(AttributeModifier modifier) { public void addModifier(AttributeModifier modifier) {
Preconditions.checkArgument(modifier != null, "modifier"); Preconditions.checkArgument(modifier != null, "modifier");
handle.b(convert(modifier)); handle.addModifier(convert(modifier));
} }
@Override @Override
public void removeModifier(AttributeModifier modifier) { public void removeModifier(AttributeModifier modifier) {
Preconditions.checkArgument(modifier != null, "modifier"); Preconditions.checkArgument(modifier != null, "modifier");
handle.c(convert(modifier)); handle.removeModifier(convert(modifier));
} }
@Override @Override
@ -70,6 +70,6 @@ public class CraftAttributeInstance implements AttributeInstance {
} }
public static AttributeModifier convert(net.minecraft.server.AttributeModifier nms) { public static AttributeModifier convert(net.minecraft.server.AttributeModifier nms) {
return new AttributeModifier(nms.a(), nms.b(), nms.d(), AttributeModifier.Operation.values()[nms.c().ordinal()]); return new AttributeModifier(nms.getUniqueId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()]);
} }
} }

Datei anzeigen

@ -32,7 +32,7 @@ public class CraftBanner extends CraftBlockEntityState<TileEntityBanner> impleme
public void load(TileEntityBanner banner) { public void load(TileEntityBanner banner) {
super.load(banner); super.load(banner);
base = DyeColor.getByWoolData((byte) ((BlockBannerAbstract) this.data.getBlock()).b().getColorIndex()); // PAIL base = DyeColor.getByWoolData((byte) ((BlockBannerAbstract) this.data.getBlock()).getColor().getColorIndex());
patterns = new ArrayList<Pattern>(); patterns = new ArrayList<Pattern>();
if (banner.patterns != null) { if (banner.patterns != null) {

Datei anzeigen

@ -76,7 +76,7 @@ public class CraftBlockData implements BlockData {
protected <B extends Enum<B>> Set<B> getValues(BlockStateEnum<?> nms, Class<B> bukkit) { protected <B extends Enum<B>> Set<B> getValues(BlockStateEnum<?> nms, Class<B> bukkit) {
ImmutableSet.Builder<B> values = ImmutableSet.builder(); ImmutableSet.Builder<B> values = ImmutableSet.builder();
for (Enum<?> e : nms.d()) { for (Enum<?> e : nms.getValues()) {
values.add(toBukkit(e, bukkit)); values.add(toBukkit(e, bukkit));
} }

Datei anzeigen

@ -74,7 +74,7 @@ public final class VanillaCommandWrapper extends BukkitCommand {
return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock().getWrapper(); return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock().getWrapper();
} }
if (sender instanceof RemoteConsoleCommandSender) { if (sender instanceof RemoteConsoleCommandSender) {
return ((DedicatedServer) MinecraftServer.getServer()).remoteControlCommandListener.f(); return ((DedicatedServer) MinecraftServer.getServer()).remoteControlCommandListener.getWrapper();
} }
if (sender instanceof ConsoleCommandSender) { if (sender instanceof ConsoleCommandSender) {
return ((CraftServer) sender.getServer()).getServer().getServerCommandListener(); return ((CraftServer) sender.getServer()).getServer().getServerCommandListener();

Datei anzeigen

@ -183,7 +183,7 @@ public class CraftEnchantment extends Enchantment {
return false; return false;
} }
CraftEnchantment ench = (CraftEnchantment) other; CraftEnchantment ench = (CraftEnchantment) other;
return !target.b(ench.target); return !target.isCompatible(ench.target);
} }
public net.minecraft.server.Enchantment getHandle() { public net.minecraft.server.Enchantment getHandle() {

Datei anzeigen

@ -151,7 +151,7 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
} }
getHandle().effects.remove(existing); getHandle().effects.remove(existing);
} }
getHandle().a(CraftPotionUtil.fromBukkit(effect)); getHandle().addEffect(CraftPotionUtil.fromBukkit(effect));
getHandle().refreshEffects(); getHandle().refreshEffects();
return true; return true;
} }

Datei anzeigen

@ -41,14 +41,14 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
@Override @Override
public int getPierceLevel() { public int getPierceLevel() {
return getHandle().s(); // PAIL: rename return getHandle().getPierceLevel();
} }
@Override @Override
public void setPierceLevel(int pierceLevel) { public void setPierceLevel(int pierceLevel) {
Preconditions.checkArgument(0 <= pierceLevel && pierceLevel <= Byte.MAX_VALUE, "Pierce level out of range, expected 0 < level < 127"); Preconditions.checkArgument(0 <= pierceLevel && pierceLevel <= Byte.MAX_VALUE, "Pierce level out of range, expected 0 < level < 127");
getHandle().b((byte) pierceLevel); // PAIL: rename getHandle().setPierceLevel((byte) pierceLevel);
} }
@Override @Override

Datei anzeigen

@ -645,7 +645,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
public boolean hasCooldown(Material material) { public boolean hasCooldown(Material material) {
Preconditions.checkArgument(material != null, "material"); Preconditions.checkArgument(material != null, "material");
return getHandle().getCooldownTracker().a(CraftMagicNumbers.getItem(material)); return getHandle().getCooldownTracker().hasCooldown(CraftMagicNumbers.getItem(material));
} }
@Override @Override

Datei anzeigen

@ -1656,7 +1656,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
ItemStack hand = getInventory().getItemInMainHand(); ItemStack hand = getInventory().getItemInMainHand();
getInventory().setItemInMainHand(book); getInventory().setItemInMainHand(book);
getHandle().a(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(book), net.minecraft.server.EnumHand.MAIN_HAND); // PAIL rename openBook getHandle().openBook(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(book), net.minecraft.server.EnumHand.MAIN_HAND);
getInventory().setItemInMainHand(hand); getInventory().setItemInMainHand(hand);
} }
} }

Datei anzeigen

@ -51,7 +51,7 @@ public class CraftTippedArrow extends CraftArrow implements Arrow {
} }
getHandle().effects.remove(existing); getHandle().effects.remove(existing);
} }
getHandle().a(CraftPotionUtil.fromBukkit(effect)); getHandle().addEffect(CraftPotionUtil.fromBukkit(effect));
getHandle().refreshEffects(); getHandle().refreshEffects();
return true; return true;
} }

Datei anzeigen

@ -1232,7 +1232,7 @@ public class CraftEventFactory {
c.setChatModifier(modi); c.setChatModifier(modi);
if (c instanceof ChatMessage) { if (c instanceof ChatMessage) {
ChatMessage cm = (ChatMessage) c; ChatMessage cm = (ChatMessage) c;
Object[] oo = cm.l(); Object[] oo = cm.getArgs();
for (int i = 0; i < oo.length; i++) { for (int i = 0; i < oo.length; i++) {
Object o = oo[i]; Object o = oo[i];
if (o instanceof IChatBaseComponent) { if (o instanceof IChatBaseComponent) {
@ -1240,7 +1240,7 @@ public class CraftEventFactory {
} }
} }
} }
List<IChatBaseComponent> ls = c.a(); List<IChatBaseComponent> ls = c.getSiblings();
if (ls != null) { if (ls != null) {
for (int i = 0; i < ls.size(); i++) { for (int i = 0; i < ls.size(); i++) {
ls.set(i, stripEvents(ls.get(i))); ls.set(i, stripEvents(ls.get(i)));

Datei anzeigen

@ -19,6 +19,7 @@ import net.minecraft.server.MobSpawnerPhantom;
import net.minecraft.server.RegionLimitedWorldAccess; import net.minecraft.server.RegionLimitedWorldAccess;
import net.minecraft.server.StructureGenerator; import net.minecraft.server.StructureGenerator;
import net.minecraft.server.TileEntity; import net.minecraft.server.TileEntity;
import net.minecraft.server.VillageSiege;
import net.minecraft.server.World; import net.minecraft.server.World;
import net.minecraft.server.WorldGenFeatureConfiguration; import net.minecraft.server.WorldGenFeatureConfiguration;
import net.minecraft.server.WorldGenStage; import net.minecraft.server.WorldGenStage;
@ -39,6 +40,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator<GeneratorSettin
private final MobSpawnerPhantom mobSpawnerPhantom = new MobSpawnerPhantom(); private final MobSpawnerPhantom mobSpawnerPhantom = new MobSpawnerPhantom();
private final MobSpawnerPatrol mobSpawnerPatrol = new MobSpawnerPatrol(); private final MobSpawnerPatrol mobSpawnerPatrol = new MobSpawnerPatrol();
private final MobSpawnerCat mobSpawnerCat = new MobSpawnerCat(); private final MobSpawnerCat mobSpawnerCat = new MobSpawnerCat();
private final VillageSiege villageSiege = new VillageSiege();
private static class CustomBiomeGrid implements BiomeGrid { private static class CustomBiomeGrid implements BiomeGrid {
BiomeBase[] biome; BiomeBase[] biome;
@ -160,6 +162,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator<GeneratorSettin
this.mobSpawnerPhantom.a(worldserver, flag, flag1); this.mobSpawnerPhantom.a(worldserver, flag, flag1);
this.mobSpawnerPatrol.a(worldserver, flag, flag1); this.mobSpawnerPatrol.a(worldserver, flag, flag1);
this.mobSpawnerCat.a(worldserver, flag, flag1); this.mobSpawnerCat.a(worldserver, flag, flag1);
this.villageSiege.a(worldserver, flag, flag1);
} }
@Override @Override

Datei anzeigen

@ -29,12 +29,12 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn
@Override @Override
public int getRepairCost() { public int getRepairCost() {
return container.levelCost.b(); return container.levelCost.get();
} }
@Override @Override
public void setRepairCost(int i) { public void setRepairCost(int i) {
container.levelCost.a(i); container.levelCost.set(i);
} }
@Override @Override

Datei anzeigen

@ -94,12 +94,12 @@ public class CraftMerchantCustom extends CraftMerchant {
} }
@Override @Override
public boolean eb() { public boolean ea() {
return false; // is-regular-villager flag (hides some gui elements: xp bar, name suffix) return false; // is-regular-villager flag (hides some gui elements: xp bar, name suffix)
} }
@Override @Override
public SoundEffect ec() { public SoundEffect eb() {
return SoundEffects.ENTITY_VILLAGER_YES; return SoundEffects.ENTITY_VILLAGER_YES;
} }
} }

Datei anzeigen

@ -42,7 +42,7 @@ public class CraftMapRenderer extends MapRenderer {
} }
MapIcon decoration = (MapIcon) worldMap.decorations.get(key); MapIcon decoration = (MapIcon) worldMap.decorations.get(key);
cursors.addCursor(decoration.getX(), decoration.getY(), (byte) (decoration.getRotation() & 15), decoration.b().a(), true, CraftChatMessage.fromComponent(decoration.g())); cursors.addCursor(decoration.getX(), decoration.getY(), (byte) (decoration.getRotation() & 15), decoration.getType().a(), true, CraftChatMessage.fromComponent(decoration.getName()));
} }
} }

Datei anzeigen

@ -69,7 +69,7 @@ public class CraftBlockProjectileSource implements BlockProjectileSource {
SourceBlock isourceblock = new SourceBlock(dispenserBlock.getWorld(), dispenserBlock.getPosition()); SourceBlock isourceblock = new SourceBlock(dispenserBlock.getWorld(), dispenserBlock.getPosition());
// Copied from DispenseBehaviorProjectile // Copied from DispenseBehaviorProjectile
IPosition iposition = BlockDispenser.a(isourceblock); IPosition iposition = BlockDispenser.a(isourceblock);
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
net.minecraft.server.World world = dispenserBlock.getWorld(); net.minecraft.server.World world = dispenserBlock.getWorld();
net.minecraft.server.Entity launch = null; net.minecraft.server.Entity launch = null;

Datei anzeigen

@ -210,7 +210,7 @@ public final class CraftChatMessage {
ChatModifier modifier = text.getChatModifier() != null ? ChatModifier modifier = text.getChatModifier() != null ?
text.getChatModifier() : new ChatModifier(); text.getChatModifier() : new ChatModifier();
List<IChatBaseComponent> extras = new ArrayList<IChatBaseComponent>(); List<IChatBaseComponent> extras = new ArrayList<IChatBaseComponent>();
List<IChatBaseComponent> extrasOld = new ArrayList<IChatBaseComponent>(text.a()); List<IChatBaseComponent> extrasOld = new ArrayList<IChatBaseComponent>(text.getSiblings());
component = text = new ChatComponentText(""); component = text = new ChatComponentText("");
int pos = 0; int pos = 0;
@ -245,21 +245,21 @@ public final class CraftChatMessage {
} }
} }
List extras = component.a(); List<IChatBaseComponent> extras = component.getSiblings();
for (int i = 0; i < extras.size(); i++) { for (int i = 0; i < extras.size(); i++) {
IChatBaseComponent comp = (IChatBaseComponent) extras.get(i); IChatBaseComponent comp = extras.get(i);
if (comp.getChatModifier() != null && comp.getChatModifier().h() == null) { if (comp.getChatModifier() != null && comp.getChatModifier().getClickEvent() == null) {
extras.set(i, fixComponent(comp, matcher)); extras.set(i, fixComponent(comp, matcher));
} }
} }
if (component instanceof ChatMessage) { if (component instanceof ChatMessage) {
Object[] subs = ((ChatMessage) component).l(); Object[] subs = ((ChatMessage) component).getArgs();
for (int i = 0; i < subs.length; i++) { for (int i = 0; i < subs.length; i++) {
Object comp = subs[i]; Object comp = subs[i];
if (comp instanceof IChatBaseComponent) { if (comp instanceof IChatBaseComponent) {
IChatBaseComponent c = (IChatBaseComponent) comp; IChatBaseComponent c = (IChatBaseComponent) comp;
if (c.getChatModifier() != null && c.getChatModifier().h() == null) { if (c.getChatModifier() != null && c.getChatModifier().getClickEvent() == null) {
subs[i] = fixComponent(c, matcher); subs[i] = fixComponent(c, matcher);
} }
} else if (comp instanceof String && matcher.reset((String)comp).find()) { } else if (comp instanceof String && matcher.reset((String)comp).find()) {

Datei anzeigen

@ -188,7 +188,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
* @return string * @return string
*/ */
public String getMappingsVersion() { public String getMappingsVersion() {
return "a69acbca3007d2ae1b4b69881f0ab9ad"; return "11ae498d9cf909730659b6357e7c2afa";
} }
@Override @Override

Datei anzeigen

@ -21,7 +21,7 @@ public final class CraftNamespacedKey {
} }
public static NamespacedKey fromMinecraft(MinecraftKey minecraft) { public static NamespacedKey fromMinecraft(MinecraftKey minecraft) {
return new NamespacedKey(minecraft.b(), minecraft.getKey()); return new NamespacedKey(minecraft.getNamespace(), minecraft.getKey());
} }
public static MinecraftKey toMinecraft(NamespacedKey key) { public static MinecraftKey toMinecraft(NamespacedKey key) {

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen