13
0
geforkt von Mirrors/Paper

Mappings Update

Dieser Commit ist enthalten in:
md_5 2018-12-06 10:00:00 +11:00
Ursprung 20fc5bea2c
Commit aa36c8417b
123 geänderte Dateien mit 393 neuen und 442 gelöschten Zeilen

Datei anzeigen

@ -40,10 +40,10 @@
Advancement advancement = this.d.getAdvancementData().a((MinecraftKey) entry.getKey());
if (advancement == null) {
- AdvancementDataPlayer.a.warn("Ignored advancement \'{}\' in progress file {} - it doesn\'t exist anymore?", entry.getKey(), this.e);
- AdvancementDataPlayer.a.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e);
+ // CraftBukkit start
+ if (((MinecraftKey) entry.getKey()).b().equals("minecraft")) {
+ AdvancementDataPlayer.a.warn("Ignored advancement \'{}\' in progress file {} - it doesn\'t exist anymore?", entry.getKey(), this.e);
+ AdvancementDataPlayer.a.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e);
+ }
+ // CraftBukkit end
} else {

Datei anzeigen

@ -4,8 +4,8 @@
}
}
- Advancements.a.info("Loaded {} advancements", Integer.valueOf(this.advancements.size()));
+ // Advancements.a.info("Loaded {} advancements", Integer.valueOf(this.advancements.size())); // CraftBukkit - moved to AdvancementDataWorld#reload
- Advancements.a.info("Loaded {} advancements", this.advancements.size());
+ // Advancements.a.info("Loaded {} advancements", this.advancements.size()); // CraftBukkit - moved to AdvancementDataWorld#reload
}
public void a() {

Datei anzeigen

@ -18,7 +18,7 @@
this.a(blockstatelist_a);
this.blockStateList = blockstatelist_a.a(BlockData::new);
@@ -409,7 +409,8 @@
@@ -406,7 +406,8 @@
int j = this.getDropCount(iblockdata, i, world, blockposition, world.random);
for (int k = 0; k < j; ++k) {
@ -28,7 +28,7 @@
Item item = this.getDropType(iblockdata, world, blockposition, i).getItem();
if (item != Items.AIR) {
@@ -430,7 +431,13 @@
@@ -427,7 +428,13 @@
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack);
entityitem.n();
@ -43,7 +43,7 @@
}
}
@@ -649,7 +656,7 @@
@@ -646,7 +653,7 @@
}
public String toString() {
@ -52,7 +52,7 @@
}
public static boolean c(Block block) {
@@ -1398,8 +1405,14 @@
@@ -1395,8 +1402,14 @@
}

Datei anzeigen

@ -7,7 +7,7 @@
- if (world.worldProvider.canRespawn() && world.getBiome(blockposition) != Biomes.NETHER) {
+ // CraftBukkit - moved world and biome check into EntityHuman
+ if (true || world.worldProvider.canRespawn() && world.getBiome(blockposition) != Biomes.NETHER) {
if (((Boolean) iblockdata.get(BlockBed.OCCUPIED)).booleanValue()) {
if ((Boolean) iblockdata.get(BlockBed.OCCUPIED)) {
EntityHuman entityhuman1 = this.a(world, blockposition);
@@ -59,10 +60,22 @@

Datei anzeigen

@ -12,8 +12,8 @@
public abstract class BlockButtonAbstract extends BlockAttachable {
public static final BlockStateBoolean POWERED = BlockProperties.t;
@@ -77,6 +82,19 @@
if (((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)).booleanValue()) {
@@ -72,6 +77,19 @@
if ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)) {
return true;
} else {
+ // CraftBukkit start
@ -29,10 +29,10 @@
+ return true;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, Boolean.valueOf(true)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, true), 3);
this.a(entityhuman, world, blockposition, true);
this.c(iblockdata, world, blockposition);
@@ -118,6 +136,16 @@
@@ -113,6 +131,16 @@
if (this.E) {
this.b(iblockdata, world, blockposition);
} else {
@ -46,12 +46,12 @@
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, Boolean.valueOf(false)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, false), 3);
this.c(iblockdata, world, blockposition);
this.a((EntityHuman) null, world, blockposition, false);
@@ -137,7 +165,44 @@
@@ -132,7 +160,44 @@
boolean flag = !list.isEmpty();
boolean flag1 = ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)).booleanValue();
boolean flag1 = (Boolean) iblockdata.get(BlockButtonAbstract.POWERED);
+ // CraftBukkit start - Call interact event when arrows turn on wooden buttons
+ if (flag1 != flag && flag) {
@ -91,6 +91,6 @@
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, Boolean.valueOf(flag)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, flag), 3);
this.c(iblockdata, world, blockposition);
this.a((EntityHuman) null, world, blockposition, flag);

Datei anzeigen

@ -10,12 +10,12 @@
public static final BlockStateInteger AGE = BlockProperties.X;
@@ -31,7 +33,7 @@
int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue();
int j = (Integer) iblockdata.get(BlockCactus.AGE);
if (j == 15) {
- world.setTypeUpdate(blockposition1, this.getBlockData());
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition1, this.getBlockData()); // CraftBukkit
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockCactus.AGE, Integer.valueOf(0));
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockCactus.AGE, 0);
world.setTypeAndData(blockposition, iblockdata1, 4);
@@ -92,7 +94,9 @@

Datei anzeigen

@ -17,6 +17,6 @@
+
+ ((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate();
+ // CraftBukkit end
int i = ((Integer) iblockdata.get(BlockCake.BITES)).intValue();
int i = (Integer) iblockdata.get(BlockCake.BITES);
if (i < 6) {

Datei anzeigen

@ -143,7 +143,7 @@
+ // CraftBukkit start
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, int i) {
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCauldron.LEVEL, Integer.valueOf(MathHelper.clamp(i, 0, 3))), 2);
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCauldron.LEVEL, MathHelper.clamp(i, 0, 3)), 2);
+ this.changeLevel(world, blockposition, iblockdata, i, null, CauldronLevelChangeEvent.ChangeReason.UNKNOWN);
+ }
+
@ -167,7 +167,7 @@
@@ -185,7 +238,7 @@
IBlockData iblockdata = world.getType(blockposition);
if (((Integer) iblockdata.get(BlockCauldron.LEVEL)).intValue() < 3) {
if ((Integer) iblockdata.get(BlockCauldron.LEVEL) < 3) {
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockCauldron.LEVEL), 2);
+ this.a(world, blockposition, (IBlockData) iblockdata.a((IBlockState) BlockCauldron.LEVEL), 2); // CraftBukkit
}

Datei anzeigen

@ -10,20 +10,20 @@
public static final BlockStateInteger AGE = BlockProperties.T;
@@ -21,7 +23,7 @@
int i = ((Integer) iblockdata.get(BlockCocoa.AGE)).intValue();
int i = (Integer) iblockdata.get(BlockCocoa.AGE);
if (i < 2) {
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, Integer.valueOf(i + 1)), 2);
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, Integer.valueOf(i + 1)), 2); // CraftBukkkit
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, i + 1), 2);
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, i + 1), 2); // CraftBukkkit
}
}
@@ -109,7 +111,7 @@
@@ -106,7 +108,7 @@
}
public void b(World world, Random random, BlockPosition blockposition, IBlockData iblockdata) {
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, Integer.valueOf(((Integer) iblockdata.get(BlockCocoa.AGE)).intValue() + 1)), 2);
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, Integer.valueOf(((Integer) iblockdata.get(BlockCocoa.AGE)).intValue() + 1)), 2); // CraftBukkit
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, (Integer) iblockdata.get(BlockCocoa.AGE) + 1), 2);
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, (Integer) iblockdata.get(BlockCocoa.AGE) + 1), 2); // CraftBukkit
}
public TextureType c() {

Datei anzeigen

@ -5,10 +5,10 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (!b_(iblockdata, world, blockposition)) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, this.a.getBlockData().set(BlockCoralFan.b, Boolean.valueOf(false))).isCancelled()) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, this.a.getBlockData().set(BlockCoralFan.b, false)).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) this.a.getBlockData().set(BlockCoralFan.b, Boolean.valueOf(false)), 2);
world.setTypeAndData(blockposition, (IBlockData) this.a.getBlockData().set(BlockCoralFan.b, false), 2);
}

Datei anzeigen

@ -5,10 +5,10 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (!b_(iblockdata, world, blockposition)) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, this.c.getBlockData().set(BlockCoralFanWall.b, Boolean.valueOf(false)).set(BlockCoralFanWall.a, iblockdata.get(BlockCoralFanWall.a))).isCancelled()) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, this.c.getBlockData().set(BlockCoralFanWall.b, false).set(BlockCoralFanWall.a, iblockdata.get(BlockCoralFanWall.a))).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) this.c.getBlockData().set(BlockCoralFanWall.b, Boolean.valueOf(false))).set(BlockCoralFanWall.a, iblockdata.get(BlockCoralFanWall.a)), 2);
world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) this.c.getBlockData().set(BlockCoralFanWall.b, false)).set(BlockCoralFanWall.a, iblockdata.get(BlockCoralFanWall.a)), 2);
}

Datei anzeigen

@ -5,10 +5,10 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (!b_(iblockdata, world, blockposition)) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, this.c.getBlockData().set(BlockCoralPlant.b, Boolean.valueOf(false))).isCancelled()) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, this.c.getBlockData().set(BlockCoralPlant.b, false)).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) this.c.getBlockData().set(BlockCoralPlant.b, Boolean.valueOf(false)), 2);
world.setTypeAndData(blockposition, (IBlockData) this.c.getBlockData().set(BlockCoralPlant.b, false), 2);
}

Datei anzeigen

@ -3,8 +3,8 @@
@@ -36,6 +36,7 @@
i = MathHelper.clamp(i, 0, 15);
if (((Integer) iblockdata.get(BlockDaylightDetector.POWER)).intValue() != i) {
if ((Integer) iblockdata.get(BlockDaylightDetector.POWER) != i) {
+ i = org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, blockposition, ((Integer) iblockdata.get(POWER)), i).getNewCurrent(); // CraftBukkit - Call BlockRedstoneEvent
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDaylightDetector.POWER, Integer.valueOf(i)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDaylightDetector.POWER, i), 3);
}

Datei anzeigen

@ -18,13 +18,13 @@
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, Boolean.valueOf(false)), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, false), 2);
} else if (!flag) {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 0, 15).getNewCurrent() != 15) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, Boolean.valueOf(true)), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, true), 2);
if (!flag1) {
world.J().a(blockposition, this, this.k(iblockdata), TickListPriority.HIGH);

Datei anzeigen

@ -9,7 +9,7 @@
public class BlockDoor extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@@ -169,9 +171,24 @@
@@ -163,9 +165,24 @@
}
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) {
@ -24,15 +24,15 @@
+ int power = bukkitBlock.getBlockPower();
+ int powerTop = blockTop.getBlockPower();
+ if (powerTop > power) power = powerTop;
+ int oldPower = ((Boolean) iblockdata.get(BlockDoor.POWERED)).booleanValue() ? 15 : 0;
+ int oldPower = (Boolean) iblockdata.get(BlockDoor.POWERED) ? 15 : 0;
+
+ if (oldPower == 0 ^ power == 0) {
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, oldPower, power);
+ world.getServer().getPluginManager().callEvent(eventRedstone);
- if (block != this && flag != ((Boolean) iblockdata.get(BlockDoor.POWERED)).booleanValue()) {
- if (block != this && flag != (Boolean) iblockdata.get(BlockDoor.POWERED)) {
+ boolean flag = eventRedstone.getNewCurrent() > 0;
+ // CraftBukkit end
if (flag != ((Boolean) iblockdata.get(BlockDoor.OPEN)).booleanValue()) {
if (flag != (Boolean) iblockdata.get(BlockDoor.OPEN)) {
this.b(world, blockposition, flag);
}

Datei anzeigen

@ -49,7 +49,7 @@
Block block = world.getType(blockposition.down()).getBlock();
@@ -90,7 +113,7 @@
int i = ((Integer) iblockdata.get(BlockFire.AGE)).intValue();
int i = (Integer) iblockdata.get(BlockFire.AGE);
if (!flag && world.isRaining() && this.a(world, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) {
- world.setAir(blockposition);
@ -99,14 +99,14 @@
if (i2 > 0 && random.nextInt(k1) <= i2 && (!world.isRaining() || !this.a(world, (BlockPosition) blockposition_mutableblockposition))) {
int j2 = Math.min(15, i + random.nextInt(5) / 4);
- world.setTypeAndData(blockposition_mutableblockposition, (IBlockData) this.a((IBlockAccess) world, (BlockPosition) blockposition_mutableblockposition).set(BlockFire.AGE, Integer.valueOf(j2)), 3);
- world.setTypeAndData(blockposition_mutableblockposition, (IBlockData) this.a((IBlockAccess) world, (BlockPosition) blockposition_mutableblockposition).set(BlockFire.AGE, j2), 3);
+ // CraftBukkit start - Call to stop spread of fire
+ if (world.getType(blockposition_mutableblockposition) != Blocks.FIRE) {
+ if (CraftEventFactory.callBlockIgniteEvent(world, blockposition_mutableblockposition, blockposition).isCancelled()) {
+ continue;
+ }
+
+ CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition_mutableblockposition, (IBlockData) this.a((IBlockAccess) world, (BlockPosition) blockposition_mutableblockposition).set(BlockFire.AGE, Integer.valueOf(j2)), 3); // CraftBukkit
+ CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition_mutableblockposition, (IBlockData) this.a((IBlockAccess) world, (BlockPosition) blockposition_mutableblockposition).set(BlockFire.AGE, j2), 3); // CraftBukkit
+ }
+ // CraftBukkit end
}

Datei anzeigen

@ -2,20 +2,20 @@
+++ b/net/minecraft/server/BlockFluids.java
@@ -57,10 +57,10 @@
public VoxelShape a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) {
Fluid fluid = iblockaccess.b(blockposition.up());
Fluid fluid = iblockaccess.getFluid(blockposition.up());
- return fluid.c().a((FluidType) this.b) ? VoxelShapes.b() : (VoxelShape) this.o.computeIfAbsent(iblockdata, (iblockdata) -> {
- Fluid fluid = iblockdata.s();
+ return fluid.c().a((FluidType) this.b) ? VoxelShapes.b() : (VoxelShape) this.o.computeIfAbsent(iblockdata, (iblockdata1) -> { // CraftBukkit - decompile errors
+ Fluid fluid1 = iblockdata1.s();
- return VoxelShapes.a(0.0D, 0.0D, 0.0D, 1.0D, (double) fluid.f(), 1.0D);
+ return VoxelShapes.a(0.0D, 0.0D, 0.0D, 1.0D, (double) fluid1.f(), 1.0D);
- return VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, (double) fluid.getHeight(), 1.0D);
+ return VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, (double) fluid1.getHeight(), 1.0D);
});
}
@@ -117,14 +117,20 @@
Fluid fluid = world.b(blockposition);
Fluid fluid = world.getFluid(blockposition);
if (fluid.d()) {
- world.setTypeUpdate(blockposition, Blocks.OBSIDIAN.getBlockData());
@ -28,7 +28,7 @@
return false;
}
if (fluid.f() >= 0.44444445F) {
if (fluid.getHeight() >= 0.44444445F) {
- world.setTypeUpdate(blockposition, Blocks.COBBLESTONE.getBlockData());
- this.fizz(world, blockposition);
+ // CraftBukkit start

Datei anzeigen

@ -3,7 +3,7 @@
@@ -52,7 +52,7 @@
IBlockData iblockdata1 = world.getType(blockposition1);
if (iblockdata1.getBlock() == Blocks.WATER && ((Integer) iblockdata.get(BlockKelp.a)).intValue() < 25 && random.nextDouble() < 0.14D) {
if (iblockdata1.getBlock() == Blocks.WATER && (Integer) iblockdata.get(BlockKelp.a) < 25 && random.nextDouble() < 0.14D) {
- world.setTypeUpdate(blockposition1, (IBlockData) iblockdata.a((IBlockState) BlockKelp.a));
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition1, (IBlockData) iblockdata.a((IBlockState) BlockKelp.a)); // CraftBukkit
}

Datei anzeigen

@ -12,7 +12,7 @@
@@ -20,6 +22,14 @@
public void b(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (!((Boolean) iblockdata.get(BlockLeaves.PERSISTENT)).booleanValue() && ((Integer) iblockdata.get(BlockLeaves.DISTANCE)).intValue() == 7) {
if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7) {
+ // CraftBukkit start
+ LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event);

Datei anzeigen

@ -8,7 +8,7 @@
public class BlockLever extends BlockAttachable {
public static final BlockStateBoolean POWERED = BlockProperties.t;
@@ -73,6 +75,20 @@
@@ -66,6 +68,20 @@
return true;
} else {

Datei anzeigen

@ -25,5 +25,5 @@
+ // CraftBukkit end
+
if (flag1 && !flag) {
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockMinecartDetector.POWERED, Boolean.valueOf(true)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockMinecartDetector.POWERED, true), 3);
this.b(world, blockposition, iblockdata, true);

Datei anzeigen

@ -3,7 +3,7 @@
@@ -25,7 +25,7 @@
if (i < 3 && random.nextInt(10) == 0) {
iblockdata = (IBlockData) iblockdata.set(BlockNetherWart.AGE, Integer.valueOf(i + 1));
iblockdata = (IBlockData) iblockdata.set(BlockNetherWart.AGE, i + 1);
- world.setTypeAndData(blockposition, iblockdata, 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, blockposition, iblockdata, 2); // CraftBukkit
}

Datei anzeigen

@ -2,13 +2,13 @@
+++ b/net/minecraft/server/BlockNote.java
@@ -24,7 +24,7 @@
if (flag != ((Boolean) iblockdata.get(BlockNote.POWERED)).booleanValue()) {
if (flag != (Boolean) iblockdata.get(BlockNote.POWERED)) {
if (flag) {
- this.play(world, blockposition);
+ this.play(world, blockposition, iblockdata); // CraftBukkit
}
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockNote.POWERED, Boolean.valueOf(flag)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockNote.POWERED, flag), 3);
@@ -32,9 +32,14 @@
}

Datei anzeigen

@ -12,19 +12,19 @@
@@ -25,8 +27,18 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (((Boolean) iblockdata.get(BlockObserver.b)).booleanValue()) {
if ((Boolean) iblockdata.get(BlockObserver.b)) {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 15, 0).getNewCurrent() != 0) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, Boolean.valueOf(false)), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, false), 2);
} else {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 0, 15).getNewCurrent() != 15) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, Boolean.valueOf(true)), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, true), 2);
world.J().a(blockposition, this, 2);
}

Datei anzeigen

@ -19,7 +19,7 @@
public class BlockPiston extends BlockDirectional {
public static final BlockStateBoolean EXTENDED = BlockProperties.f;
@@ -111,6 +123,18 @@
@@ -106,6 +118,18 @@
}
}
@ -38,7 +38,7 @@
world.playBlockAction(blockposition, this, b0, enumdirection.a());
}
@@ -285,6 +309,48 @@
@@ -278,6 +302,48 @@
IBlockData[] aiblockdata = new IBlockData[j];
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite();
HashSet hashset = Sets.newHashSet(list);
@ -85,5 +85,5 @@
+ }
+ // CraftBukkit end
int k;
BlockPosition blockposition3;
int k;

Datei anzeigen

@ -13,7 +13,7 @@
public class BlockPortal extends Block {
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.z;
@@ -37,7 +43,8 @@
@@ -36,7 +42,8 @@
}
if (i > 0 && !world.getType(blockposition1.up()).isOccluding()) {
@ -23,7 +23,7 @@
if (entity != null) {
entity.portalCooldown = entity.aQ();
@@ -55,8 +62,10 @@
@@ -54,8 +61,10 @@
BlockPortal.Shape blockportal_shape = this.b(generatoraccess, blockposition);
if (blockportal_shape != null) {
@ -36,7 +36,7 @@
} else {
return false;
}
@@ -93,6 +102,10 @@
@@ -92,6 +101,10 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.bm()) {
@ -47,7 +47,7 @@
entity.e(blockposition);
}
@@ -193,6 +206,7 @@
@@ -189,6 +202,7 @@
private BlockPosition position;
private int height;
private int width;
@ -55,7 +55,7 @@
public Shape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
this.a = generatoraccess;
@@ -251,6 +265,9 @@
@@ -247,6 +261,9 @@
}
protected int c() {
@ -65,7 +65,7 @@
int i;
label56:
@@ -273,11 +290,21 @@
@@ -269,11 +286,21 @@
block = this.a.getType(blockposition.shift(this.d)).getBlock();
if (block != Blocks.OBSIDIAN) {
break label56;
@ -87,7 +87,7 @@
}
}
}
@@ -287,6 +314,11 @@
@@ -283,6 +310,11 @@
if (this.a.getType(this.position.shift(this.c, i).up(this.height)).getBlock() != Blocks.OBSIDIAN) {
this.height = 0;
break;
@ -99,7 +99,7 @@
}
}
@@ -310,7 +342,27 @@
@@ -306,7 +338,27 @@
return this.position != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
}
@ -128,7 +128,7 @@
for (int i = 0; i < this.width; ++i) {
BlockPosition blockposition = this.position.shift(this.c, i);
@@ -319,6 +371,7 @@
@@ -315,6 +367,7 @@
}
}

Datei anzeigen

@ -8,7 +8,7 @@
public class BlockPoweredRail extends BlockMinecartTrackAbstract {
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.S;
@@ -106,6 +108,13 @@
@@ -101,6 +103,13 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || this.a(world, blockposition, iblockdata, true, 0) || this.a(world, blockposition, iblockdata, false, 0);
if (flag1 != flag) {
@ -19,6 +19,6 @@
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPoweredRail.POWERED, Boolean.valueOf(flag1)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPoweredRail.POWERED, flag1), 3);
world.applyPhysics(blockposition.down(), this);
if (((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)).c()) {

Datei anzeigen

@ -9,7 +9,7 @@
public class BlockPressurePlateBinary extends BlockPressurePlateAbstract {
public static final BlockStateBoolean POWERED = BlockProperties.t;
@@ -63,6 +65,26 @@
@@ -61,6 +63,26 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();

Datei anzeigen

@ -14,7 +14,7 @@
public static final BlockStateDirection a = BlockFacingHorizontal.FACING;
@@ -38,18 +44,24 @@
int j;
ShapeDetectorBlock shapedetectorblock;
int k;
+ BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator

Datei anzeigen

@ -20,7 +20,7 @@
});
@@ -118,8 +121,18 @@
boolean flag1 = ((Boolean) iblockdata.get(BlockRedstoneComparator.c)).booleanValue();
boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneComparator.c);
if (flag1 && !flag) {
+ // CraftBukkit start
@ -28,13 +28,13 @@
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneComparator.c, Boolean.valueOf(false)), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneComparator.c, false), 2);
} else if (!flag1 && flag) {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 0, 15).getNewCurrent() != 15) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneComparator.c, Boolean.valueOf(true)), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneComparator.c, true), 2);
}

Datei anzeigen

@ -24,7 +24,7 @@
@@ -43,6 +50,11 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (!world.isClientSide) {
if (((Boolean) iblockdata.get(BlockRedstoneLamp.a)).booleanValue() && !world.isBlockIndirectlyPowered(blockposition)) {
if ((Boolean) iblockdata.get(BlockRedstoneLamp.a) && !world.isBlockIndirectlyPowered(blockposition)) {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 15, 0).getNewCurrent() != 0) {
+ return;

Datei anzeigen

@ -53,25 +53,25 @@
- private static void interact(IBlockData iblockdata, World world, BlockPosition blockposition) {
+ private static void interact(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { // CraftBukkit - add Entity
playEffect(world, blockposition);
if (!((Boolean) iblockdata.get(BlockRedstoneOre.a)).booleanValue()) {
if (!(Boolean) iblockdata.get(BlockRedstoneOre.a)) {
+ // CraftBukkit start
+ if (CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, iblockdata.set(BlockRedstoneOre.a, Boolean.valueOf(true))).isCancelled()) {
+ if (CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, iblockdata.set(BlockRedstoneOre.a, true)).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, Boolean.valueOf(true)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, true), 3);
}
@@ -40,6 +66,11 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (((Boolean) iblockdata.get(BlockRedstoneOre.a)).booleanValue()) {
if ((Boolean) iblockdata.get(BlockRedstoneOre.a)) {
+ // CraftBukkit start
+ if (CraftEventFactory.callBlockFadeEvent(world, blockposition, iblockdata.set(BlockRedstoneOre.a, Boolean.valueOf(false))).isCancelled()) {
+ if (CraftEventFactory.callBlockFadeEvent(world, blockposition, iblockdata.set(BlockRedstoneOre.a, false)).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, Boolean.valueOf(false)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, false), 3);
}
@@ -59,12 +90,25 @@

Datei anzeigen

@ -20,7 +20,7 @@
+
+ BlockRedstoneEvent event = new BlockRedstoneEvent(block, oldCurrent, oldCurrent);
+ // CraftBukkit end
if (((Boolean) iblockdata.get(BlockRedstoneTorch.LIT)).booleanValue()) {
if ((Boolean) iblockdata.get(BlockRedstoneTorch.LIT)) {
if (flag) {
+ // CraftBukkit start
+ if (oldCurrent != 0) {
@ -31,7 +31,7 @@
+ }
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, Boolean.valueOf(false)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, false), 3);
if (a(world, blockposition, true)) {
world.a((EntityHuman) null, blockposition, SoundEffects.BLOCK_REDSTONE_TORCH_BURNOUT, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
@@ -83,6 +101,15 @@
@ -47,7 +47,7 @@
+ }
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, Boolean.valueOf(true)), 3);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, true), 3);
}
@@ -112,7 +139,7 @@

Datei anzeigen

@ -23,5 +23,5 @@
+ // CraftBukkit end
+
if (i != j) {
iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, Integer.valueOf(j));
iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, j);
if (world.getType(blockposition) == iblockdata1) {

Datei anzeigen

@ -1,11 +1,11 @@
--- a/net/minecraft/server/BlockReed.java
+++ b/net/minecraft/server/BlockReed.java
@@ -29,7 +29,7 @@
int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue();
int j = (Integer) iblockdata.get(BlockReed.AGE);
if (j == 15) {
- world.setTypeUpdate(blockposition.up(), this.getBlockData());
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, blockposition.up(), this.getBlockData()); // CraftBukkit
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockReed.AGE, Integer.valueOf(0)), 4);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockReed.AGE, 0), 4);
} else {
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockReed.AGE, Integer.valueOf(j + 1)), 4);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockReed.AGE, j + 1), 4);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockSnow.java
+++ b/net/minecraft/server/BlockSnow.java
@@ -88,6 +88,11 @@
@@ -85,6 +85,11 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (world.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 11) {

Datei anzeigen

@ -16,14 +16,14 @@
if (!a((IWorldReader) world, blockposition) && !world.isRainingAt(blockposition.up())) {
if (i > 0) {
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, Integer.valueOf(i - 1)), 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, Integer.valueOf(i - 1)), 2); // CraftBukkit
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, i - 1), 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, i - 1), 2); // CraftBukkit
} else if (!a((IBlockAccess) world, blockposition)) {
b(iblockdata, world, blockposition);
}
} else if (i < 7) {
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, Integer.valueOf(7)), 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, Integer.valueOf(7)), 2); // CraftBukkit
- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, 7), 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, 7), 2); // CraftBukkit
}
}

Datei anzeigen

@ -15,7 +15,7 @@
@@ -33,6 +39,7 @@
linkedlist.add(new Tuple(blockposition, Integer.valueOf(0)));
linkedlist.add(new Tuple(blockposition, 0));
int i = 0;
+ BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator
@ -29,14 +29,14 @@
+ if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).a(blockList, blockposition2, iblockdata) != FluidTypes.a) { // CraftBukkit
++i;
if (j < 6) {
linkedlist.add(new Tuple(blockposition2, Integer.valueOf(j + 1)));
linkedlist.add(new Tuple(blockposition2, j + 1));
}
} else if (iblockdata.getBlock() instanceof BlockFluids) {
- world.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3);
+ blockList.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3); // CraftBukkit
++i;
if (j < 6) {
linkedlist.add(new Tuple(blockposition2, Integer.valueOf(j + 1)));
linkedlist.add(new Tuple(blockposition2, j + 1));
}
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
- iblockdata.a(world, blockposition2, 0);
@ -45,7 +45,7 @@
+ blockList.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3); // CraftBukkit
++i;
if (j < 6) {
linkedlist.add(new Tuple(blockposition2, Integer.valueOf(j + 1)));
linkedlist.add(new Tuple(blockposition2, j + 1));
@@ -75,6 +82,31 @@
break;
}

Datei anzeigen

@ -12,7 +12,7 @@
@@ -33,14 +35,18 @@
if (i < 7) {
iblockdata = (IBlockData) iblockdata.set(BlockStem.AGE, Integer.valueOf(i + 1));
iblockdata = (IBlockData) iblockdata.set(BlockStem.AGE, i + 1);
- world.setTypeAndData(blockposition, iblockdata, 2);
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, iblockdata, 2); // CraftBukkit
} else {
@ -31,8 +31,8 @@
}
}
@@ -94,7 +100,7 @@
int i = Math.min(7, ((Integer) iblockdata.get(BlockStem.AGE)).intValue() + MathHelper.nextInt(world.random, 2, 5));
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockStem.AGE, Integer.valueOf(i));
int i = Math.min(7, (Integer) iblockdata.get(BlockStem.AGE) + MathHelper.nextInt(world.random, 2, 5));
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockStem.AGE, i);
- world.setTypeAndData(blockposition, iblockdata1, 2);
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, iblockdata1, 2); // CraftBukkit

Datei anzeigen

@ -8,10 +8,10 @@
public class BlockTrapdoor extends BlockFacingHorizontal implements IFluidSource, IFluidContainer {
@@ -94,6 +95,19 @@
@@ -88,6 +89,19 @@
boolean flag = world.isBlockIndirectlyPowered(blockposition);
if (flag != ((Boolean) iblockdata.get(BlockTrapdoor.c)).booleanValue()) {
if (flag != (Boolean) iblockdata.get(BlockTrapdoor.c)) {
+ // CraftBukkit start
+ org.bukkit.World bworld = world.getWorld();
+ org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
@ -25,6 +25,6 @@
+ flag = eventRedstone.getNewCurrent() > 0;
+ }
+ // CraftBukkit end
if (((Boolean) iblockdata.get(BlockTrapdoor.OPEN)).booleanValue() != flag) {
iblockdata = (IBlockData) iblockdata.set(BlockTrapdoor.OPEN, Boolean.valueOf(flag));
if ((Boolean) iblockdata.get(BlockTrapdoor.OPEN) != flag) {
iblockdata = (IBlockData) iblockdata.set(BlockTrapdoor.OPEN, flag);
this.a((EntityHuman) null, world, blockposition, flag);

Datei anzeigen

@ -48,5 +48,5 @@
+ // CraftBukkit end
+
if (flag1 != flag) {
iblockdata = (IBlockData) iblockdata.set(BlockTripwire.POWERED, Boolean.valueOf(flag1));
iblockdata = (IBlockData) iblockdata.set(BlockTripwire.POWERED, flag1);
world.setTypeAndData(blockposition, iblockdata, 3);

Datei anzeigen

@ -9,7 +9,7 @@
public class BlockTripwireHook extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@@ -137,6 +139,17 @@
@@ -134,6 +136,17 @@
this.a(world, blockposition1, flag4, flag5, flag2, flag3);
}

Datei anzeigen

@ -17,28 +17,28 @@
+ BlockPosition source = blockposition;
+
if (flag && this.b((IBlockAccess) world, blockposition3, enumdirection1)) {
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), Boolean.valueOf(true)), 2);
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), true), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), true), 2);
} else if (flag1 && this.b((IBlockAccess) world, blockposition4, enumdirection2)) {
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2);
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), true), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), true), 2);
} else {
EnumDirection enumdirection3 = enumdirection.opposite();
if (flag && world.isEmpty(blockposition3) && this.b((IBlockAccess) world, blockposition.shift(enumdirection1), enumdirection3)) {
- world.setTypeAndData(blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
- world.setTypeAndData(blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), true), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), true), 2);
} else if (flag1 && world.isEmpty(blockposition4) && this.b((IBlockAccess) world, blockposition.shift(enumdirection2), enumdirection3)) {
- world.setTypeAndData(blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
- world.setTypeAndData(blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), true), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), true), 2);
} else if ((double) world.random.nextFloat() < 0.05D && this.b((IBlockAccess) world, blockposition2.up(), EnumDirection.UP)) {
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, Boolean.valueOf(true)), 2);
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, true), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, true), 2);
}
+ // CraftBukkit end
}
} else if (this.b((IBlockAccess) world, blockposition2, enumdirection)) {
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), Boolean.valueOf(true)), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), true), 2);
@@ -226,7 +232,7 @@
}

Datei anzeigen

@ -239,9 +239,9 @@
if (this.t instanceof ProtoChunkTickList) {
- ((ProtoChunkTickList) this.t).a(this.world.I(), (blockposition) -> {
- return this.world.b(blockposition).c();
- return this.world.getFluid(blockposition).c();
+ ((ProtoChunkTickList<FluidType>) this.t).a(this.world.I(), (blockposition1) -> { // CraftBukkit - decompile error
+ return this.world.b(blockposition1).c();
+ return this.world.getFluid(blockposition1).c();
});
}

Datei anzeigen

@ -34,7 +34,7 @@
+ this.chunks.put(ChunkCoordIntPair.a(i, j), chunk1);
});
} catch (Exception exception) {
ChunkProviderServer.a.error("Couldn\'t load chunk", exception);
ChunkProviderServer.a.error("Couldn't load chunk", exception);
@@ -103,7 +109,7 @@
try {
this.batchScheduler.b();

Datei anzeigen

@ -131,7 +131,7 @@
ChunkStatus.Type chunkstatus_type = this.a(nbttagcompound);
@@ -151,10 +209,28 @@
ChunkRegionLoader.a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(chunk.locX), Integer.valueOf(chunk.locZ));
ChunkRegionLoader.a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", i, j, i, j, chunk.locX, chunk.locZ);
nbttagcompound1.setInt("xPos", i);
nbttagcompound1.setInt("zPos", j);
+

Datei anzeigen

@ -85,7 +85,7 @@
+ // CraftBukkit end
StringReader stringreader = new StringReader(s);
if (stringreader.canRead() && stringreader.peek() == 47) {
if(stringreader.canRead() && stringreader.peek() == 47) {
@@ -128,7 +182,6 @@
byte b0;
@ -104,22 +104,22 @@
+ return b0;
} catch (CommandSyntaxException commandsyntaxexception) {
commandlistenerwrapper.sendFailureMessage(ChatComponentUtils.a(commandsyntaxexception.getRawMessage()));
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
if(commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
- IChatBaseComponent ichatbasecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).a((chatmodifier) -> {
- chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, s));
- });
+ chatcomponenttext = new ChatComponentText("");
if (j > 10) {
if(j > 10) {
- ichatbasecomponent.a("...");
+ chatcomponenttext.a("...");
}
- ichatbasecomponent.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j));
+ chatcomponenttext.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j));
if (j < commandsyntaxexception.getInput().length()) {
- IChatBaseComponent ichatbasecomponent1 = (new ChatComponentText(commandsyntaxexception.getInput().substring(j))).a(new EnumChatFormat[] { EnumChatFormat.RED, EnumChatFormat.UNDERLINE});
if(j < commandsyntaxexception.getInput().length()) {
- IChatBaseComponent ichatbasecomponent1 = (new ChatComponentText(commandsyntaxexception.getInput().substring(j))).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.UNDERLINE});
+ ChatComponentText chatcomponenttext1 = new ChatComponentText(commandsyntaxexception.getInput().substring(j));
- ichatbasecomponent.addSibling(ichatbasecomponent1);
@ -128,7 +128,7 @@
+ chatcomponenttext.addSibling(chatcomponenttext1);
}
- ichatbasecomponent.addSibling((new ChatMessage("command.context.here", new Object[0])).a(new EnumChatFormat[] { EnumChatFormat.RED, EnumChatFormat.ITALIC}));
- ichatbasecomponent.addSibling((new ChatMessage("command.context.here", new Object[0])).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.ITALIC}));
- commandlistenerwrapper.sendFailureMessage(ichatbasecomponent);
+ ChatMessage chatmessage = new ChatMessage("command.context.here", new Object[0]);
+
@ -147,17 +147,17 @@
- chatcomponenttext = new ChatComponentText;
- }
-
- chatcomponenttext.<init>(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
- chatcomponenttext.<init>(exception.getMessage() == null?exception.getClass().getName():exception.getMessage());
- ChatComponentText chatcomponenttext1 = chatcomponenttext;
+ ChatMessage chatmessage1 = new ChatMessage("command.failed", new Object[0]);
- if (CommandDispatcher.a.isDebugEnabled()) {
- if(CommandDispatcher.a.isDebugEnabled()) {
- StackTraceElement[] astacktraceelement = exception.getStackTrace();
+ chatcomponenttext = new ChatComponentText(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
+ if (CommandDispatcher.a.isDebugEnabled()) {
+ StackTraceElement[] astacktraceelement = exception.getStackTrace();
- for (int k = 0; k < Math.min(astacktraceelement.length, 3); ++k) {
- for(int k = 0; k < Math.min(astacktraceelement.length, 3); ++k) {
- chatcomponenttext1.a("\n\n").a(astacktraceelement[k].getMethodName()).a("\n ").a(astacktraceelement[k].getFileName()).a(":").a(String.valueOf(astacktraceelement[k].getLineNumber()));
+ for (int k = 0; k < Math.min(astacktraceelement.length, 3); ++k) {
+ chatcomponenttext.a("\n\n" + astacktraceelement[k].getMethodName() + "\n " + astacktraceelement[k].getFileName() + ":" + astacktraceelement[k].getLineNumber());

Datei anzeigen

@ -36,7 +36,7 @@
return 0;
@@ -106,7 +106,7 @@
if (i2 > 256L) {
throw CommandForceload.a.create(Integer.valueOf(256), Long.valueOf(i2));
throw CommandForceload.a.create(256, i2);
} else {
- DimensionManager dimensionmanager = commandlistenerwrapper.getWorld().o().getDimensionManager();
+ DimensionManager dimensionmanager = commandlistenerwrapper.getWorld().dimension; // CraftBukkit

Datei anzeigen

@ -38,7 +38,7 @@
protected Slot a(Slot slot) {
@@ -128,6 +151,7 @@
l = playerinventory.getCarried().getCount();
k = playerinventory.getCarried().getCount();
Iterator iterator = this.h.iterator();
+ Map<Integer, ItemStack> draggedSlots = new HashMap<Integer, ItemStack>(); // CraftBukkit - Store slots from drag in map (raw slot id -> new stack)
@ -48,19 +48,19 @@
@@ -143,12 +167,48 @@
}
l -= itemstack4.getCount() - j1;
k -= itemstack4.getCount() - j1;
- slot1.set(itemstack4);
+ // slot1.set(itemstack4);
+ draggedSlots.put(slot1.rawSlotIndex, itemstack4); // CraftBukkit - Put in map instead of setting
}
}
- itemstack2.setCount(l);
- itemstack2.setCount(k);
- playerinventory.setCarried(itemstack2);
+ // CraftBukkit start - InventoryDragEvent
+ InventoryView view = getBukkitView();
+ org.bukkit.inventory.ItemStack newcursor = CraftItemStack.asCraftMirror(itemstack2);
+ newcursor.setAmount(l);
+ newcursor.setAmount(k);
+ Map<Integer, org.bukkit.inventory.ItemStack> eventmap = new HashMap<Integer, org.bukkit.inventory.ItemStack>();
+ for (Map.Entry<Integer, ItemStack> ditem : draggedSlots.entrySet()) {
+ eventmap.put(ditem.getKey(), CraftItemStack.asBukkitCopy(ditem.getValue()));
@ -126,7 +126,7 @@
}
}
} else if (inventoryclicktype == InventoryClickType.SWAP && j >= 0 && j < 9) {
@@ -567,6 +639,7 @@
@@ -565,6 +637,7 @@
if (inventorycraftresult.a(world, entityplayer, irecipe) && irecipe != null) {
itemstack = irecipe.craftItem(iinventory);
}

Datei anzeigen

@ -46,7 +46,7 @@
return;
}
@@ -144,7 +155,7 @@
this.k = l;
this.k = i1;
} else {
if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.e())) {
- this.g.setItem(0, ItemStack.a);
@ -54,7 +54,7 @@
this.levelCost = 0;
return;
}
@@ -237,7 +248,7 @@
@@ -234,7 +245,7 @@
}
if (flag2 && !flag1) {
@ -63,7 +63,7 @@
this.levelCost = 0;
return;
}
@@ -261,11 +272,11 @@
@@ -258,11 +269,11 @@
itemstack1 = ItemStack.a;
}
@ -78,7 +78,7 @@
itemstack1 = ItemStack.a;
}
@@ -284,7 +295,7 @@
@@ -281,7 +292,7 @@
EnchantmentManager.a(map, itemstack1);
}
@ -87,7 +87,7 @@
this.b();
}
}
@@ -302,6 +313,7 @@
@@ -299,6 +310,7 @@
}
public boolean canUse(EntityHuman entityhuman) {
@ -95,7 +95,7 @@
return !this.i.getType(this.j).a(TagsBlock.ANVIL) ? false : entityhuman.d((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D;
}
@@ -357,4 +369,33 @@
@@ -354,4 +366,33 @@
this.d();
}

Datei anzeigen

@ -2,7 +2,7 @@
+++ b/net/minecraft/server/CrashReport.java
@@ -63,6 +63,7 @@
return String.format("%d total; %s", new Object[] { Integer.valueOf(list.size()), list.stream().collect(Collectors.joining(" "))});
return String.format("%d total; %s", new Object[] { list.size(), list.stream().collect(Collectors.joining(" "))});
});
+ this.d.a("CraftBukkit Information", (CrashReportCallable) new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit
}

Datei anzeigen

@ -22,7 +22,7 @@
+ datafixerbuilder.addFixer(new com.mojang.datafixers.DataFix(schema47, false) {
+ @Override
+ protected com.mojang.datafixers.TypeRewriteRule makeRule() {
+ return this.fixTypeEverywhereTyped("Player CustomName", this.getInputSchema().getType(DataConverterTypes.b), (typed) -> {
+ return this.fixTypeEverywhereTyped("Player CustomName", this.getInputSchema().getType(DataConverterTypes.PLAYER), (typed) -> {
+ return typed.update(DSL.remainderFinder(), (dynamic) -> {
+ return DataConverterCustomNameEntity.a(dynamic);
+ });

Datei anzeigen

@ -426,7 +426,7 @@
+
this.a = true;
if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) {
world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, Integer.valueOf(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);
@@ -318,6 +610,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
@ -518,8 +518,8 @@
+ String s1 = (String) function.apply(object); // CraftBukkit - decompile error
if (!localelanguage.b(s)) {
DispenserRegistry.c.warn("Missing translation for {}: {} (key: \'{}\')", s1, iregistry.getKey(object), s);
@@ -487,6 +848,30 @@
DispenserRegistry.c.warn("Missing translation for {}: {} (key: '{}')", s1, iregistry.getKey(object), s);
@@ -482,6 +843,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP;
@ -550,7 +550,7 @@
this.a = ((ItemBlock) item).a((BlockActionContext) (new DispenserRegistry.b(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))) == EnumInteractionResult.SUCCESS;
if (this.a) {
itemstack.subtract(1);
@@ -540,12 +925,40 @@
@@ -535,12 +920,40 @@
d3 = 0.0D;
}

Datei anzeigen

@ -30,7 +30,7 @@
+
this.currentDragonController = this.b(dragoncontrollerphase);
if (!this.enderDragon.world.isClientSide) {
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, Integer.valueOf(dragoncontrollerphase.b()));
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, dragoncontrollerphase.b());
@@ -42,6 +59,6 @@
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
}

Datei anzeigen

@ -1,18 +1,20 @@
--- a/net/minecraft/server/EnchantmentFrostWalker.java
+++ b/net/minecraft/server/EnchantmentFrostWalker.java
@@ -1,5 +1,8 @@
@@ -1,6 +1,10 @@
package net.minecraft.server;
import java.util.Iterator;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.event.block.EntityBlockFormEvent;
+
import java.util.Iterator;
+// CraftBukkit end
public class EnchantmentFrostWalker extends Enchantment {
@@ -42,8 +45,11 @@
@@ -42,8 +46,11 @@
IBlockData iblockdata2 = world.getType(blockposition_mutableblockposition1);
if (iblockdata2.getMaterial() == Material.WATER && ((Integer) iblockdata2.get(BlockFluids.LEVEL)).intValue() == 0 && iblockdata.canPlace(world, blockposition_mutableblockposition1) && world.a(iblockdata, (BlockPosition) blockposition_mutableblockposition1)) {
if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition_mutableblockposition1) && world.a(iblockdata, (BlockPosition) blockposition_mutableblockposition1)) {
- world.setTypeUpdate(blockposition_mutableblockposition1, iblockdata);
- world.J().a(blockposition_mutableblockposition1.h(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+ // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker

Datei anzeigen

@ -1,11 +0,0 @@
--- a/net/minecraft/server/EnderDragonBattle.java
+++ b/net/minecraft/server/EnderDragonBattle.java
@@ -21,7 +21,7 @@
private static final Logger a = LogManager.getLogger();
private static final Predicate<Entity> b = IEntitySelector.a.and(IEntitySelector.a(0.0D, 128.0D, 0.0D, 192.0D));
- private final BossBattleServer c;
+ public final BossBattleServer c; // PAIL private -> public, rename bossBattleServer
private final WorldServer d;
private final List<Integer> e;
private final ShapeDetector f;

Datei anzeigen

@ -322,8 +322,8 @@
return true;
@@ -1319,6 +1506,18 @@
try {
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY, this.locZ}));
nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ}));
nbttagcompound.set("Pos", this.a(this.locX, this.locY, this.locZ));
nbttagcompound.set("Motion", this.a(this.motX, this.motY, this.motZ));
+
+ // CraftBukkit start - Checking for NaN pitch/yaw and resetting to zero
+ // TODO: make sure this is the best way to address this.
@ -336,7 +336,7 @@
+ }
+ // CraftBukkit end
+
nbttagcompound.set("Rotation", this.a(new float[] { this.yaw, this.pitch}));
nbttagcompound.set("Rotation", this.a(this.yaw, this.pitch));
nbttagcompound.setFloat("FallDistance", this.fallDistance);
nbttagcompound.setShort("Fire", (short) this.fireTicks);
@@ -1328,6 +1527,12 @@
@ -547,14 +547,14 @@
}
public void setAirTicks(int i) {
- this.datawatcher.set(Entity.aD, Integer.valueOf(i));
- this.datawatcher.set(Entity.aD, i);
+ // CraftBukkit start
+ EntityAirChangeEvent event = new EntityAirChangeEvent(this.getBukkitEntity(), i);
+ event.getEntity().getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return;
+ }
+ this.datawatcher.set(Entity.aD, Integer.valueOf(event.getAmount()));
+ this.datawatcher.set(Entity.aD, event.getAmount());
+ // CraftBukkit end
}

Datei anzeigen

@ -32,7 +32,7 @@
+ // CraftBukkit end
+
public int getColor() {
return ((Integer) this.getDataWatcher().get(EntityAreaEffectCloud.c)).intValue();
return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.c);
}
@@ -245,6 +265,7 @@
if (!list.isEmpty()) {
@ -57,7 +57,7 @@
+ if (entity instanceof CraftLivingEntity) {
+ EntityLiving entityliving = ((CraftLivingEntity) entity).getHandle();
+ // CraftBukkit end
this.h.put(entityliving, Integer.valueOf(this.ticksLived + this.reapplicationDelay));
this.h.put(entityliving, this.ticksLived + this.reapplicationDelay);
Iterator iterator3 = arraylist.iterator();
@@ -263,7 +295,7 @@

Datei anzeigen

@ -30,7 +30,7 @@
public final void setSize(float f, float f1) {
double d0 = this.locX;
double d1 = this.locY;
@@ -357,6 +373,21 @@
@@ -354,6 +370,21 @@
if (itemstack1.isEmpty() || (this.bH & 1 << enumitemslot.c() + 8) == 0) {
if (!itemstack1.isEmpty() || (this.bH & 1 << enumitemslot.c() + 16) == 0) {
ItemStack itemstack2;
@ -52,7 +52,7 @@
if (entityhuman.abilities.canInstantlyBuild && itemstack1.isEmpty() && !itemstack.isEmpty()) {
itemstack2 = itemstack.cloneItemStack();
@@ -378,14 +409,19 @@
@@ -375,14 +406,19 @@
}
public boolean damageEntity(DamageSource damagesource, float f) {
@ -74,7 +74,7 @@
return false;
} else if (DamageSource.FIRE.equals(damagesource)) {
if (this.isBurning()) {
@@ -409,7 +445,7 @@
@@ -406,7 +442,7 @@
} else if (damagesource.v()) {
this.F();
this.A();
@ -83,7 +83,7 @@
return false;
} else {
long i = this.world.getTime();
@@ -420,7 +456,7 @@
@@ -417,7 +453,7 @@
} else {
this.B();
this.A();
@ -92,7 +92,7 @@
}
return true;
@@ -447,7 +483,7 @@
@@ -444,7 +480,7 @@
f1 -= f;
if (f1 <= 0.5F) {
this.D();
@ -101,7 +101,7 @@
} else {
this.setHealth(f1);
}
@@ -455,7 +491,7 @@
@@ -452,7 +488,7 @@
}
private void B() {
@ -110,7 +110,7 @@
this.D();
}
@@ -468,7 +504,7 @@
@@ -465,7 +501,7 @@
for (i = 0; i < this.bE.size(); ++i) {
itemstack = (ItemStack) this.bE.get(i);
if (!itemstack.isEmpty()) {
@ -119,7 +119,7 @@
this.bE.set(i, ItemStack.a);
}
}
@@ -476,7 +512,7 @@
@@ -473,7 +509,7 @@
for (i = 0; i < this.bF.size(); ++i) {
itemstack = (ItemStack) this.bF.get(i);
if (!itemstack.isEmpty()) {
@ -128,7 +128,7 @@
this.bF.set(i, ItemStack.a);
}
}
@@ -588,6 +624,7 @@
@@ -585,6 +621,7 @@
}
public void killEntity() {

Datei anzeigen

@ -93,7 +93,7 @@
super.collide(entity);
}
@@ -173,6 +228,7 @@
@@ -168,6 +223,7 @@
return this.getDirection().e();
}
@ -101,7 +101,7 @@
public void tick() {
this.aM = this.aL;
this.aL = this.s();
@@ -217,6 +273,22 @@
@@ -212,6 +268,22 @@
this.motZ = 0.0D;
}
@ -124,7 +124,7 @@
this.q();
for (int i = 0; i <= 1; ++i) {
@@ -737,6 +809,11 @@
@@ -730,6 +802,11 @@
this.c(this.fallDistance, 1.0F);
if (!this.world.isClientSide && !this.dead) {
@ -136,7 +136,7 @@
this.die();
if (this.world.getGameRules().getBoolean("doEntityDrops")) {
int i;
@@ -750,6 +827,7 @@
@@ -743,6 +820,7 @@
}
}
}

Datei anzeigen

@ -32,7 +32,7 @@
public void onLightningStrike(EntityLightning entitylightning) {
super.onLightningStrike(entitylightning);
- this.datawatcher.set(EntityCreeper.b, Boolean.valueOf(true));
- this.datawatcher.set(EntityCreeper.b, true);
+ // CraftBukkit start
+ if (CraftEventFactory.callCreeperPowerEvent(this, entitylightning, org.bukkit.event.entity.CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) {
+ return;

Datei anzeigen

@ -44,7 +44,7 @@
}
@@ -277,8 +295,12 @@
boolean flag = movingobjectposition != null && movingobjectposition.a().equals(blockposition);
boolean flag = movingobjectposition != null && movingobjectposition.getBlockPosition().equals(blockposition);
if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
- this.enderman.setCarried(iblockdata);

Datei anzeigen

@ -12,7 +12,7 @@
@@ -47,6 +47,7 @@
public void setFromBucket(boolean flag) {
this.datawatcher.set(EntityFish.a, Boolean.valueOf(flag));
this.datawatcher.set(EntityFish.a, flag);
+ this.persistent = this.isPersistent(); // CraftBukkit - SPIGOT-4106 update persistence
}

Datei anzeigen

@ -117,7 +117,7 @@
ItemStack itemstack1 = this.a(entityitem);
if (flag1) {
@@ -655,6 +704,13 @@
@@ -652,6 +701,13 @@
this.a(true, true, false);
}
@ -131,7 +131,7 @@
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
this.e = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
this.f = nbttagcompound.getBoolean("SpawnForced");
@@ -705,6 +761,7 @@
@@ -702,6 +758,7 @@
if (!this.getShoulderEntityRight().isEmpty()) {
nbttagcompound.set("ShoulderEntityRight", this.getShoulderEntityRight());
}
@ -139,7 +139,7 @@
}
@@ -722,10 +779,10 @@
@@ -719,10 +776,10 @@
this.a(true, true, false);
}
@ -152,7 +152,7 @@
}
if (this.world.getDifficulty() == EnumDifficulty.EASY) {
@@ -737,7 +794,13 @@
@@ -734,7 +791,13 @@
}
}
@ -167,7 +167,7 @@
}
}
}
@@ -751,10 +814,29 @@
@@ -748,10 +811,29 @@
}
public boolean a(EntityHuman entityhuman) {
@ -200,7 +200,7 @@
}
protected void damageArmor(float f) {
@@ -797,7 +879,12 @@
@@ -794,7 +876,12 @@
return (float) i / (float) this.inventory.armor.size();
}
@ -214,7 +214,7 @@
if (!this.isInvulnerable(damagesource)) {
f = this.applyArmorModifier(damagesource, f);
f = this.applyMagicModifier(damagesource, f);
@@ -823,6 +910,7 @@
@@ -820,6 +907,7 @@
}
}
@ -222,7 +222,7 @@
}
public void openSign(TileEntitySign tileentitysign) {}
@@ -944,8 +1032,15 @@
@@ -941,8 +1029,15 @@
if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isBurning()) {
@ -240,7 +240,7 @@
}
}
@@ -976,8 +1071,11 @@
@@ -973,8 +1068,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h(entityliving) < 9.0D) {
@ -253,7 +253,7 @@
}
}
@@ -986,11 +1084,28 @@
@@ -983,11 +1081,28 @@
}
if (entity instanceof EntityPlayer && entity.velocityChanged) {
@ -282,7 +282,7 @@
}
if (flag2) {
@@ -1039,7 +1154,14 @@
@@ -1036,7 +1151,14 @@
this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
if (j > 0) {
@ -298,7 +298,7 @@
}
if (this.world instanceof WorldServer && f5 > 2.0F) {
@@ -1055,6 +1177,11 @@
@@ -1052,6 +1174,11 @@
if (flag4) {
entity.extinguish();
}
@ -310,7 +310,7 @@
}
}
@@ -1116,15 +1243,15 @@
@@ -1113,15 +1240,15 @@
return this.h;
}
@ -330,7 +330,7 @@
return EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE;
}
@@ -1146,6 +1273,26 @@
@@ -1143,6 +1270,26 @@
}
}
}
@ -357,7 +357,7 @@
if (this.isPassenger()) {
this.stopRiding();
@@ -1212,6 +1359,24 @@
@@ -1209,6 +1356,24 @@
this.world.everyoneSleeping();
}
@ -382,7 +382,7 @@
this.sleepTicks = flag ? 0 : 100;
if (flag2) {
this.setRespawnPosition(this.bedPosition, false);
@@ -1263,9 +1428,11 @@
@@ -1260,9 +1425,11 @@
if (blockposition != null) {
this.e = blockposition;
this.f = flag;
@ -394,7 +394,7 @@
}
}
@@ -1331,7 +1498,11 @@
@@ -1328,7 +1495,11 @@
this.motY = d3 * 0.6D;
this.aU = f3;
this.fallDistance = 0.0F;
@ -407,7 +407,7 @@
} else {
super.a(f, f1, f2);
}
@@ -1631,13 +1802,17 @@
@@ -1628,13 +1799,17 @@
}
protected void releaseShoulderEntities() {
@ -430,7 +430,7 @@
if (!this.world.isClientSide && !nbttagcompound.isEmpty()) {
Entity entity = EntityTypes.a(nbttagcompound, this.world);
@@ -1646,9 +1821,10 @@
@@ -1643,9 +1818,10 @@
}
entity.setPosition(this.locX, this.locY + 0.699999988079071D, this.locZ);
@ -442,7 +442,7 @@
}
public abstract boolean isSpectator();
@@ -1859,7 +2035,7 @@
@@ -1856,7 +2032,7 @@
return entitymonster.c(this.a);
}

Datei anzeigen

@ -135,7 +135,7 @@
}
this.setSlot(enumitemslot, itemstack);
@@ -554,11 +624,11 @@
@@ -553,11 +623,11 @@
double d2 = entityhuman.locZ - this.locZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
@ -149,7 +149,7 @@
this.die();
} else if (d3 < 1024.0D) {
this.ticksFarFromPlayer = 0;
@@ -942,12 +1012,24 @@
@@ -931,12 +1001,24 @@
public final boolean b(EntityHuman entityhuman, EnumHand enumhand) {
if (this.isLeashed() && this.getLeashHolder() == entityhuman) {
@ -174,7 +174,7 @@
this.setLeashHolder(entityhuman, true);
itemstack.subtract(1);
return true;
@@ -968,10 +1050,12 @@
@@ -957,10 +1039,12 @@
if (this.bK) {
if (!this.isAlive()) {
@ -187,7 +187,7 @@
this.unleash(true, true);
}
}
@@ -982,7 +1066,9 @@
@@ -971,7 +1055,9 @@
this.bK = false;
this.leashHolder = null;
if (!this.world.isClientSide && flag1) {
@ -197,7 +197,7 @@
}
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
@@ -1052,6 +1138,7 @@
@@ -1041,6 +1127,7 @@
this.setLeashHolder(entityleash, true);
} else {
@ -205,7 +205,7 @@
this.unleash(false, true);
}
}
@@ -1147,7 +1234,14 @@
@@ -1136,7 +1223,14 @@
int j = EnchantmentManager.getFireAspectEnchantmentLevel(this);
if (j > 0) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityItemFrame.java
+++ b/net/minecraft/server/EntityItemFrame.java
@@ -97,6 +97,11 @@
@@ -95,6 +95,11 @@
return false;
} else if (!damagesource.isExplosion() && !this.getItem().isEmpty()) {
if (!this.world.isClientSide) {
@ -12,7 +12,7 @@
this.b(damagesource.getEntity(), false);
this.a(SoundEffects.ENTITY_ITEM_FRAME_REMOVE_ITEM, 1.0F, 1.0F);
}
@@ -170,6 +175,12 @@
@@ -168,6 +173,12 @@
}
public void setItem(ItemStack itemstack, boolean flag) {
@ -25,7 +25,7 @@
if (!itemstack.isEmpty()) {
itemstack = itemstack.cloneItemStack();
itemstack.setCount(1);
@@ -177,7 +188,7 @@
@@ -175,7 +186,7 @@
}
this.getDataWatcher().set(EntityItemFrame.e, itemstack);

Datei anzeigen

@ -203,7 +203,7 @@
if (this.updateEffects) {
if (!this.world.isClientSide) {
@@ -569,7 +672,13 @@
this.datawatcher.set(EntityLiving.g, Integer.valueOf(0));
this.datawatcher.set(EntityLiving.g, 0);
}
+ // CraftBukkit start
@ -352,7 +352,7 @@
+ return (float) ((EntityPlayer) this).getBukkitEntity().getHealth();
+ }
+ // CraftBukkit end
return ((Float) this.datawatcher.get(EntityLiving.HEALTH)).floatValue();
return (Float) this.datawatcher.get(EntityLiving.HEALTH);
}
public void setHealth(float f) {
@ -372,7 +372,7 @@
+ return;
+ }
+ // CraftBukkit end
this.datawatcher.set(EntityLiving.HEALTH, Float.valueOf(MathHelper.a(f, 0.0F, this.getMaxHealth())));
this.datawatcher.set(EntityLiving.HEALTH, MathHelper.a(f, 0.0F, this.getMaxHealth()));
}
@@ -711,15 +911,17 @@
@ -733,7 +733,7 @@
this.setFlag(7, false);
}
} else {
@@ -1910,6 +2296,7 @@
@@ -1907,6 +2293,7 @@
}
if (!this.world.isClientSide) {
@ -741,7 +741,7 @@
this.setFlag(7, flag);
}
@@ -2037,11 +2424,11 @@
@@ -2034,11 +2421,11 @@
}
public boolean isInteractable() {
@ -755,7 +755,7 @@
}
protected void aA() {
@@ -2201,7 +2588,27 @@
@@ -2198,7 +2585,27 @@
protected void q() {
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
this.b(this.activeItem, 16);
@ -784,7 +784,7 @@
this.da();
}
@@ -2280,10 +2687,18 @@
@@ -2277,10 +2684,18 @@
}
if (flag1) {

Datei anzeigen

@ -34,7 +34,7 @@
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
super(entitytypes, world);
this.j = true;
@@ -98,6 +118,19 @@
@@ -92,6 +112,19 @@
if (this.isInvulnerable(damagesource)) {
return false;
} else {
@ -54,7 +54,7 @@
this.k(-this.u());
this.d(10);
this.aA();
@@ -105,6 +138,15 @@
@@ -99,6 +132,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.getDamage() > 40.0F) {
@ -70,7 +70,7 @@
this.ejectPassengers();
if (flag && !this.hasCustomName()) {
this.die();
@@ -143,6 +185,14 @@
@@ -137,6 +179,14 @@
}
public void tick() {
@ -85,7 +85,7 @@
if (this.getType() > 0) {
this.d(this.getType() - 1);
}
@@ -157,6 +207,8 @@
@@ -151,6 +201,8 @@
int i;
@ -94,7 +94,7 @@
if (!this.world.isClientSide && this.world instanceof WorldServer) {
this.world.methodProfiler.a("portal");
MinecraftServer minecraftserver = this.world.getMinecraftServer();
@@ -196,6 +248,7 @@
@@ -190,6 +242,7 @@
this.world.methodProfiler.e();
}
@ -102,7 +102,7 @@
if (this.world.isClientSide) {
if (this.aw > 0) {
@@ -263,6 +316,18 @@
@@ -257,6 +310,18 @@
}
this.setYawPitch(this.yaw, this.pitch);
@ -121,7 +121,7 @@
if (this.v() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.motX * this.motX + this.motZ * this.motZ > 0.01D) {
List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.a(this));
@@ -271,8 +336,24 @@
@@ -265,8 +330,24 @@
Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@ -146,7 +146,7 @@
entity.collide(this);
}
}
@@ -284,6 +365,14 @@
@@ -278,6 +359,14 @@
Entity entity1 = (Entity) iterator.next();
if (!this.w(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) {
@ -161,7 +161,7 @@
entity1.collide(this);
}
}
@@ -294,7 +383,7 @@
@@ -288,7 +377,7 @@
}
protected double p() {
@ -170,7 +170,7 @@
}
public void a(int i, int j, int k, boolean flag) {}
@@ -305,16 +394,20 @@
@@ -299,16 +388,20 @@
this.motX = MathHelper.a(this.motX, -d0, d0);
this.motZ = MathHelper.a(this.motZ, -d0, d0);
if (this.onGround) {
@ -197,7 +197,7 @@
}
}
@@ -502,7 +595,7 @@
@@ -493,7 +586,7 @@
}
protected void r() {
@ -206,7 +206,7 @@
this.motX *= 0.996999979019165D;
this.motY *= 0.0D;
this.motZ *= 0.996999979019165D;
@@ -599,6 +692,14 @@
@@ -590,6 +683,14 @@
if (!this.world.isClientSide) {
if (!entity.noclip && !this.noclip) {
if (!this.w(entity)) {
@ -221,7 +221,7 @@
double d0 = entity.locX - this.locX;
double d1 = entity.locZ - this.locZ;
double d2 = d0 * d0 + d1 * d1;
@@ -745,4 +846,26 @@
@@ -736,4 +837,26 @@
return this.i;
}
}

Datei anzeigen

@ -583,11 +583,27 @@
+ PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(getBukkitEntity(), packetplayinsettings.b());
+ this.server.server.getPluginManager().callEvent(event);
+ }
+ this.clientViewDistance = packetplayinsettings.b;
+ this.clientViewDistance = packetplayinsettings.viewDistance;
+ // CraftBukkit end
this.locale = packetplayinsettings.b();
this.cs = packetplayinsettings.d();
this.ct = packetplayinsettings.e();
@@ -1023,13 +1285,13 @@
if (entity instanceof EntityHuman) {
this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[] { entity.getId()}));
} else {
- this.removeQueue.add(entity.getId());
+ this.removeQueue.add((Integer) entity.getId()); // CraftBukkit - decompile error
}
}
public void d(Entity entity) {
- this.removeQueue.remove(entity.getId());
+ this.removeQueue.remove((Integer) entity.getId()); // CraftBukkit - decompile error
}
protected void C() {
@@ -1053,7 +1315,7 @@
this.cv = (Entity) (entity == null ? this : entity);
if (entity1 != this.cv) {

Datei anzeigen

@ -18,7 +18,7 @@
flag = true;
} else {
@@ -148,6 +149,11 @@
this.e(movingobjectposition.a());
this.e(movingobjectposition.getBlockPosition());
} else {
this.a(movingobjectposition);
+ // CraftBukkit start

Datei anzeigen

@ -18,7 +18,7 @@
@@ -397,9 +403,23 @@
Integer integer = (Integer) iblockdata.get(BlockCarrots.AGE);
if (integer.intValue() == 0) {
if (integer == 0) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.f, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
+ return;
@ -31,11 +31,11 @@
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(
+ this.f,
+ blockposition,
+ iblockdata.set(BlockCarrots.AGE, Integer.valueOf(integer.intValue() - 1))
+ iblockdata.set(BlockCarrots.AGE, integer - 1)
+ ).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCarrots.AGE, Integer.valueOf(integer.intValue() - 1)), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCarrots.AGE, integer - 1), 2);
world.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata));
}

Datei anzeigen

@ -30,7 +30,7 @@
enummap.put(EnumColor.WHITE, Blocks.WHITE_WOOL);
enummap.put(EnumColor.ORANGE, Blocks.ORANGE_WOOL);
enummap.put(EnumColor.MAGENTA, Blocks.MAGENTA_WOOL);
@@ -158,11 +171,22 @@
@@ -143,11 +156,22 @@
if (itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) {
if (!this.world.isClientSide) {
@ -53,7 +53,7 @@
if (entityitem != null) {
entityitem.motY += (double) (this.random.nextFloat() * 0.05F);
@@ -247,6 +271,12 @@
@@ -232,6 +256,12 @@
}
public void x() {
@ -66,7 +66,7 @@
this.setSheared(false);
if (this.isBaby()) {
this.setAge(60);
@@ -267,6 +297,7 @@
@@ -252,6 +282,7 @@
this.container.setItem(0, new ItemStack(ItemDye.a(enumcolor)));
this.container.setItem(1, new ItemStack(ItemDye.a(enumcolor1)));

Datei anzeigen

@ -11,7 +11,7 @@
public class EntityShulker extends EntityGolem implements IMonster {
@@ -326,8 +330,17 @@
@@ -321,8 +325,17 @@
EnumDirection enumdirection = aenumdirection[k];
if (this.world.q(blockposition1.shift(enumdirection))) {
@ -31,7 +31,7 @@
break;
}
}
@@ -372,6 +385,7 @@
@@ -367,6 +380,7 @@
this.locX = (double) blockposition.getX() + 0.5D;
this.locY = (double) blockposition.getY();
this.locZ = (double) blockposition.getZ() + 0.5D;

Datei anzeigen

@ -45,7 +45,7 @@
- if (flag) {
+ // CraftBukkit start
+ if (isIncendiary) {
BlockPosition blockposition = movingobjectposition.a().shift(movingobjectposition.direction);
BlockPosition blockposition = movingobjectposition.getBlockPosition().shift(movingobjectposition.direction);
if (this.world.isEmpty(blockposition)) {
- this.world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());

Datei anzeigen

@ -1,14 +1,5 @@
--- a/net/minecraft/server/EntityThrownTrident.java
+++ b/net/minecraft/server/EntityThrownTrident.java
@@ -5,7 +5,7 @@
public class EntityThrownTrident extends EntityArrow {
private static final DataWatcherObject<Byte> h = DataWatcher.a(EntityThrownTrident.class, DataWatcherRegistry.a);
- private ItemStack aw;
+ public ItemStack aw; // PAIL
private boolean ax;
public int g;
@@ -122,7 +122,7 @@
EntityLightning entitylightning = new EntityLightning(this.world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, false);

Datei anzeigen

@ -24,7 +24,7 @@
+ // CraftBukkit end
+
public int getColor() {
return ((Integer) this.datawatcher.get(EntityTippedArrow.g)).intValue();
return (Integer) this.datawatcher.get(EntityTippedArrow.g);
}
@@ -180,7 +199,7 @@

Datei anzeigen

@ -27,7 +27,7 @@
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.f, this.d.up(), Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, Integer.valueOf(this.f.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.setTypeAndData(this.d.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, Integer.valueOf(this.f.random.nextInt(4) + 1)), 3);
world.setTypeAndData(this.d.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.f.random.nextInt(4) + 1), 3);
+ }
+ // CraftBukkit end
this.f.s(false);

Datei anzeigen

@ -73,7 +73,7 @@
}
}
@@ -574,7 +604,12 @@
@@ -569,7 +599,12 @@
entitywitch.setCustomNameVisible(this.getCustomNameVisible());
}

Datei anzeigen

@ -13,15 +13,6 @@
public class EntityWither extends EntityMonster implements IRangedEntity {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
@@ -19,7 +25,7 @@
private final int[] bI = new int[2];
private final int[] bJ = new int[2];
private int bK;
- private final BossBattleServer bL;
+ public final BossBattleServer bL; // PAIL private -> public, rename bossBattleServer
private static final Predicate<Entity> bM = (entity) -> {
return entity instanceof EntityLiving && ((EntityLiving) entity).getMonsterType() != EnumMonsterType.UNDEAD && ((EntityLiving) entity).df();
};
@@ -181,13 +187,38 @@
if (this.dz() > 0) {
i = this.dz() - 1;
@ -84,4 +75,4 @@
+ this.heal(1.0F, EntityRegainHealthEvent.RegainReason.REGEN); // CraftBukkit
}
this.bL.setProgress(this.getHealth() / this.getMaxHealth());
this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth());

Datei anzeigen

@ -17,7 +17,7 @@
protected static final IAttribute c = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
@@ -21,6 +30,7 @@
private int bJ;
private int drownedConversionTime;
private float bK;
private float bL;
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
@ -28,15 +28,15 @@
public void tick() {
if (!this.world.isClientSide) {
- if (this.dG()) {
- --this.bJ;
- if (this.isDrownConverting()) {
- --this.drownedConversionTime;
+ // CraftBukkit start - Use wall time instead of ticks for conversion
+ if (this.dG() && this.isAlive()) {
+ if (this.isDrownConverting() && this.isAlive()) {
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
+ this.lastTick = MinecraftServer.currentTick;
+ this.bJ -= elapsedTicks;
+ this.drownedConversionTime -= elapsedTicks;
+ // CraftBukkit end
if (this.bJ < 0) {
if (this.drownedConversionTime < 0) {
this.dE();
}
@@ -182,7 +196,14 @@

Datei anzeigen

@ -37,7 +37,7 @@
@@ -100,8 +110,10 @@
this.bD = uuid;
this.conversionTime = i;
this.getDataWatcher().set(EntityZombieVillager.a, Boolean.valueOf(true));
this.getDataWatcher().set(EntityZombieVillager.a, true);
- this.removeEffect(MobEffects.WEAKNESS);
- this.addEffect(new MobEffect(MobEffects.INCREASE_DAMAGE, i, Math.min(this.world.getDifficulty().a() - 1, 0)));
+ // CraftBukkit start

Datei anzeigen

@ -23,7 +23,7 @@
@@ -145,6 +150,15 @@
Fluid fluid1 = this.a((IWorldReader) generatoraccess, blockposition1, iblockdata1);
if (this.a(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.b(blockposition1), fluid1.c())) {
if (this.a(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.c())) {
+ // CraftBukkit start
+ org.bukkit.block.Block source = CraftBlock.at(generatoraccess, blockposition);
+ BlockFromToEvent event = new BlockFromToEvent(source, BlockFace.DOWN);
@ -39,7 +39,7 @@
@@ -175,6 +189,15 @@
IBlockData iblockdata1 = generatoraccess.getType(blockposition1);
if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.b(blockposition1), fluid1.c())) {
if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.c())) {
+ // CraftBukkit start
+ org.bukkit.block.Block source = CraftBlock.at(generatoraccess, blockposition);
+ BlockFromToEvent event = new BlockFromToEvent(source, org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(enumdirection));

Datei anzeigen

@ -67,4 +67,4 @@
+ ((LoginListener) this.b.i()).hostname = packethandshakinginsetprotocol.hostname + ":" + packethandshakinginsetprotocol.port; // CraftBukkit - set hostname
}
break;
case STATUS:

Datei anzeigen

@ -5,13 +5,13 @@
return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
} else if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK) {
+ // CraftBukkit start - Boat placement
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectposition.a(), movingobjectposition.direction, itemstack, enumhand);
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectposition.getBlockPosition(), movingobjectposition.direction, itemstack, enumhand);
+
+ if (event.isCancelled()) {
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
+ }
+ // CraftBukkit end
BlockPosition blockposition = movingobjectposition.a();
BlockPosition blockposition = movingobjectposition.getBlockPosition();
Block block = world.getType(blockposition).getBlock();
EntityBoat entityboat = new EntityBoat(world, movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z);
@@ -62,7 +69,7 @@

Datei anzeigen

@ -87,8 +87,8 @@
boolean flag1 = material.isReplaceable();
if (!world.isEmpty(blockposition) && !flag && !flag1 && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).canPlace(world, blockposition, iblockdata, this.fluidType))) {
- return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null);
+ return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack); // CraftBukkit
- return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.getBlockPosition().shift(movingobjectposition.direction), (MovingObjectPosition) null);
+ return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.getBlockPosition().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack); // CraftBukkit
} else {
+ // CraftBukkit start
+ if (entityhuman != null) {

Datei anzeigen

@ -37,7 +37,7 @@
+ }
+
+ itemstack.damage(1, entityhuman);
+ entitythrowntrident.aw = itemstack.cloneItemStack(); // SPIGOT-4511 update since damage call moved
+ entitythrowntrident.trident = itemstack.cloneItemStack(); // SPIGOT-4511 update since damage call moved
+ // CraftBukkit end
+
if (!entityhuman.abilities.canInstantlyBuild) {

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/ItemWaterLily.java
+++ b/net/minecraft/server/ItemWaterLily.java
@@ -30,7 +30,15 @@
Fluid fluid = world.b(blockposition);
Fluid fluid = world.getFluid(blockposition);
if ((fluid.c() == FluidTypes.c || material == Material.ICE) && world.isEmpty(blockposition1)) {
+ // CraftBukkit start - special case for handling block placement with water lilies

Datei anzeigen

@ -116,7 +116,7 @@
} else if (LoginListener.this.server.H()) {
@@ -160,6 +220,11 @@
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down", new Object[0]));
LoginListener.c.error("Couldn\'t verify username because servers are unavailable");
LoginListener.c.error("Couldn't verify username because servers are unavailable");
}
+ // CraftBukkit start - catch all exceptions
+ } catch (Exception exception) {

Datei anzeigen

@ -26,7 +26,7 @@
}
@Nullable
@@ -127,11 +130,11 @@
@@ -124,11 +127,11 @@
return LootTableInfo.EntityTarget.a(jsonreader.nextString());
}
@ -40,7 +40,7 @@
this.a(jsonwriter, (LootTableInfo.EntityTarget) object);
}
}
@@ -141,6 +144,7 @@
@@ -138,6 +141,7 @@
private final WorldServer a;
private float b;
@ -48,7 +48,7 @@
private Entity c;
private EntityHuman d;
private DamageSource e;
@@ -175,8 +179,15 @@
@@ -172,8 +176,15 @@
return this;
}

Datei anzeigen

@ -38,14 +38,14 @@
+ if (!ENABLED) return; // CraftBukkit
if (this.d && !this.c.isEmpty()) {
long i = SystemUtils.c();
long j = ((Long) this.c.remove(this.c.size() - 1)).longValue();
long j = (Long) this.c.remove(this.c.size() - 1);
@@ -92,6 +97,7 @@
}
public List<MethodProfiler.ProfilerInfo> b(String s) {
+ if (!ENABLED) return Collections.emptyList(); // CraftBukkit
long i = this.f.containsKey("root") ? ((Long) this.f.get("root")).longValue() : 0L;
long j = this.f.containsKey(s) ? ((Long) this.f.get(s)).longValue() : -1L;
long i = this.f.containsKey("root") ? (Long) this.f.get("root") : 0L;
long j = this.f.containsKey(s) ? (Long) this.f.get(s) : -1L;
ArrayList arraylist = Lists.newArrayList();
@@ -154,11 +160,13 @@
}

Datei anzeigen

@ -261,9 +261,9 @@
- this.getPlayerList().setPlayerFileData(worldserver);
- if (worlddata.P() != null) {
- this.aP().a(worlddata.P());
- this.getBossBattleCustomData().a(worlddata.P());
+ if (worlddata.P() != null) {
+ this.aP().a(worlddata.P());
+ this.getBossBattleCustomData().a(worlddata.P());
+ }
}
+ this.a(this.getDifficulty());
@ -373,7 +373,7 @@
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld()));
+ }
+ // CraftBukkit end
MinecraftServer.LOGGER.info("Time elapsed: {} ms", Long.valueOf(stopwatch.elapsed(TimeUnit.MILLISECONDS)));
MinecraftServer.LOGGER.info("Time elapsed: {} ms", stopwatch.elapsed(TimeUnit.MILLISECONDS));
Iterator iterator = DimensionManager.b().iterator();
@@ -419,6 +571,10 @@
@ -426,7 +426,7 @@
long j = i / 50L;
+ if (server.getWarnOnOverload()) // CraftBukkit
MinecraftServer.LOGGER.warn("Can\'t keep up! Is the server overloaded? Running {}ms or {} ticks behind", Long.valueOf(i), Long.valueOf(j));
MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
this.aa += j * 50L;
this.Q = this.aa;
}

Datei anzeigen

@ -1,20 +0,0 @@
--- a/net/minecraft/server/MojangsonParser.java
+++ b/net/minecraft/server/MojangsonParser.java
@@ -82,7 +82,7 @@
}
}
- private NBTBase b(String s) {
+ public NBTBase b(String s) { // PAIL
try {
if (MojangsonParser.i.matcher(s).matches()) {
return new NBTTagFloat(Float.parseFloat(s.substring(0, s.length() - 1)));
@@ -207,7 +207,7 @@
}
}
- private NBTBase h() throws CommandSyntaxException {
+ public NBTBase h() throws CommandSyntaxException { // PAIL
this.a('[');
int i = this.n.getCursor();
char c0 = this.n.read();

Datei anzeigen

@ -1,11 +0,0 @@
--- a/net/minecraft/server/PacketPlayInSettings.java
+++ b/net/minecraft/server/PacketPlayInSettings.java
@@ -5,7 +5,7 @@
public class PacketPlayInSettings implements Packet<PacketListenerPlayIn> {
private String a;
- private int b;
+ public int b; // PAIL
private EntityHuman.EnumChatVisibility c;
private boolean d;
private int e;

Datei anzeigen

@ -16,7 +16,7 @@
if (this.h > 60) {
+ // CraftBukkit start - Step on eggs
+ EntityInteractEvent event = new EntityInteractEvent(this.g.getBukkitEntity(), CraftBlock.at(world, blockposition1));
+ EntityInteractEvent event = new EntityInteractEvent(this.entity.getBukkitEntity(), CraftBlock.at(world, blockposition1));
+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) event);
+
+ if (event.isCancelled()) {

Datei anzeigen

@ -209,7 +209,7 @@
+
+ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.H() || !this.minecraftServer.G().equals(entity.getDisplayName().getString()))) {
+ // CraftBukkit end
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), Double.valueOf(d6), Double.valueOf(d7), Double.valueOf(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));
return;
@@ -222,14 +358,72 @@
@ -325,7 +325,7 @@
});
}
@@ -492,6 +694,15 @@
@@ -490,6 +692,15 @@
}
public void a(PacketPlayInBEdit packetplayinbedit) {
@ -341,7 +341,7 @@
ItemStack itemstack = packetplayinbedit.b();
if (!itemstack.isEmpty()) {
@@ -516,11 +727,13 @@
@@ -514,11 +725,13 @@
}
itemstack2.a("pages", (NBTBase) nbttaglist);
@ -357,7 +357,7 @@
}
}
@@ -560,7 +773,7 @@
@@ -558,7 +771,7 @@
} else {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@ -366,7 +366,7 @@
if (this.e == 0) {
this.syncPosition();
}
@@ -570,13 +783,21 @@
@@ -568,13 +781,21 @@
this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
}
@ -389,7 +389,7 @@
double d0 = this.player.locX;
double d1 = this.player.locY;
double d2 = this.player.locZ;
@@ -601,15 +822,33 @@
@@ -599,15 +820,33 @@
++this.receivedMovePackets;
int i = this.receivedMovePackets - this.processedMovePackets;
@ -400,7 +400,7 @@
+ this.lastTick = (int) (System.currentTimeMillis() / 50);
+
+ if (i > Math.max(this.allowedPlayerTicks, 5)) {
PlayerConnection.LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", this.player.getDisplayName().getString(), Integer.valueOf(i));
PlayerConnection.LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", this.player.getDisplayName().getString(), i);
i = 1;
}
@ -422,10 +422,10 @@
- if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.H() || !this.minecraftServer.G().equals(this.player.getProfile().getName()))) {
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.H() || !this.minecraftServer.G().equals(this.player.getProfile().getName()))) {
+ // CraftBukkit end
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(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);
return;
@@ -655,6 +894,69 @@
@@ -653,6 +892,69 @@
}
}
@ -495,7 +495,7 @@
this.B = d12 >= -0.03125D;
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.dc() && !worldserver.a(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -672,10 +974,76 @@
@@ -670,10 +972,76 @@
}
public void a(double d0, double d1, double d2, float f, float f1) {
@ -573,7 +573,7 @@
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 d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D;
@@ -687,6 +1055,14 @@
@@ -685,6 +1053,14 @@
this.teleportAwait = 0;
}
@ -588,7 +588,7 @@
this.A = this.e;
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));
@@ -694,6 +1070,7 @@
@@ -692,6 +1068,7 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer());
@ -596,7 +596,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.b();
@@ -703,14 +1080,46 @@
@@ -701,13 +1078,45 @@
if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@ -624,7 +624,6 @@
}
return;
case DROP_ITEM:
if (!this.player.isSpectator()) {
+ // limit how quickly items can be dropped
@ -645,7 +644,7 @@
this.player.a(false);
}
@@ -744,7 +1153,15 @@
@@ -738,7 +1147,15 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.c());
} else {
@ -661,7 +660,7 @@
}
} else {
if (packetplayinblockdig.d() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -764,10 +1181,12 @@
@@ -757,10 +1174,12 @@
default:
throw new IllegalArgumentException("Invalid player action");
}
@ -674,7 +673,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.d();
ItemStack itemstack = this.player.b(enumhand);
@@ -780,6 +1199,13 @@
@@ -773,6 +1192,13 @@
this.player.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, ChatMessageType.GAME_INFO));
} else if (this.teleportPos == null && this.player.d((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)) {
@ -688,7 +687,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.e(), packetplayinuseitem.f(), packetplayinuseitem.g());
}
@@ -789,13 +1215,52 @@
@@ -782,13 +1208,52 @@
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer());
@ -728,7 +727,7 @@
+ player.playerInteractManager.firedInteract = false;
+ cancelled = player.playerInteractManager.interactResult;
+ } else {
+ org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, movingobjectposition.a(), movingobjectposition.direction, itemstack, true, enumhand);
+ org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, movingobjectposition.getBlockPosition(), movingobjectposition.direction, itemstack, true, enumhand);
+ cancelled = event.useItemInHand() == Event.Result.DENY;
+ }
+ }
@ -742,7 +741,7 @@
}
}
@@ -815,13 +1280,18 @@
@@ -808,13 +1273,18 @@
}
if (entity != null) {
@ -763,7 +762,7 @@
public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.getWorldServer());
@@ -834,11 +1304,26 @@
@@ -827,11 +1297,26 @@
}
public void a(IChatBaseComponent ichatbasecomponent) {
@ -791,7 +790,7 @@
if (this.minecraftServer.H() && this.player.getDisplayName().getString().equals(this.minecraftServer.G())) {
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
this.minecraftServer.safeShutdown();
@@ -864,6 +1349,15 @@
@@ -857,6 +1342,15 @@
}
}
@ -807,7 +806,7 @@
try {
this.networkManager.sendPacket(packet, genericfuturelistener);
} catch (Throwable throwable) {
@@ -879,17 +1373,37 @@
@@ -872,17 +1366,37 @@
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer());
@ -847,7 +846,7 @@
this.sendPacket(new PacketPlayOutChat((new ChatMessage("chat.cannotSend", new Object[0])).a(EnumChatFormat.RED)));
} else {
this.player.resetIdleTimer();
@@ -899,39 +1413,249 @@
@@ -892,39 +1406,249 @@
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@ -1104,7 +1103,7 @@
this.player.resetIdleTimer();
IJumpable ijumpable;
@@ -1003,6 +1727,7 @@
@@ -987,6 +1711,7 @@
public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer());
@ -1112,7 +1111,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver);
@@ -1018,20 +1743,73 @@
@@ -1002,20 +1727,73 @@
if (this.player.h(entity) < d0) {
EnumHand enumhand;
@ -1187,7 +1186,7 @@
}
}
}
@@ -1047,7 +1825,8 @@
@@ -1031,7 +1809,8 @@
case PERFORM_RESPAWN:
if (this.player.viewingCredits) {
this.player.viewingCredits = false;
@ -1197,7 +1196,7 @@
CriterionTriggers.v.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD);
} else {
if (this.player.getHealth() > 0.0F) {
@@ -1070,14 +1849,20 @@
@@ -1053,14 +1832,20 @@
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
@ -1220,7 +1219,7 @@
NonNullList nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) {
@@ -1086,8 +1871,274 @@
@@ -1069,8 +1854,274 @@
this.player.a(this.player.activeContainer, nonnulllist);
} else {
@ -1496,7 +1495,7 @@
if (ItemStack.matches(packetplayinwindowclick.f(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.b(), packetplayinwindowclick.e(), true));
this.player.f = true;
@@ -1130,6 +2181,7 @@
@@ -1113,6 +2164,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer());
@ -1504,7 +1503,7 @@
this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a(this.player, packetplayinenchantitem.c());
@@ -1161,6 +2213,43 @@
@@ -1144,6 +2196,43 @@
boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45;
boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
@ -1548,15 +1547,15 @@
if (flag1 && flag2) {
if (itemstack.isEmpty()) {
@@ -1184,6 +2273,7 @@
@@ -1167,6 +2256,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.getWorldServer());
+ if (this.player.isFrozen()) return; // CraftBukkit
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
if (oshort != null && packetplayintransaction.c() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.b() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
@@ -1194,6 +2284,7 @@
if (oshort != null && packetplayintransaction.c() == oshort && this.player.activeContainer.windowId == packetplayintransaction.b() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
@@ -1177,6 +2267,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.getWorldServer());
@ -1564,7 +1563,7 @@
this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.b();
@@ -1210,14 +2301,30 @@
@@ -1193,14 +2284,30 @@
if (!tileentitysign.d() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getDisplayName().getString() + " just tried to change non-editable sign");
@ -1596,7 +1595,7 @@
tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
@@ -1226,6 +2333,7 @@
@@ -1209,6 +2316,7 @@
}
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
@ -1604,7 +1603,7 @@
if (this.g && packetplayinkeepalive.b() == this.h) {
int i = (int) (SystemUtils.b() - this.f);
@@ -1239,7 +2347,17 @@
@@ -1222,7 +2330,17 @@
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer());
@ -1623,7 +1622,7 @@
}
public void a(PacketPlayInSettings packetplayinsettings) {
@@ -1247,5 +2365,47 @@
@@ -1230,5 +2348,47 @@
this.player.a(packetplayinsettings);
}

Datei anzeigen

@ -32,7 +32,7 @@
public static final File a = new File("banned-players.json");
@@ -28,14 +51,16 @@
private static final Logger f = LogManager.getLogger();
private static final SimpleDateFormat g = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z");
private static final SimpleDateFormat g = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
private final MinecraftServer server;
- public final List<EntityPlayer> players = Lists.newArrayList();
+ public final List<EntityPlayer> players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
@ -93,9 +93,9 @@
s1 = networkmanager.getSocketAddress().toString();
}
- PlayerList.f.info("{}[{}] logged in with entity id {} at ({}, {}, {})", entityplayer.getDisplayName().getString(), s1, Integer.valueOf(entityplayer.getId()), Double.valueOf(entityplayer.locX), Double.valueOf(entityplayer.locY), Double.valueOf(entityplayer.locZ));
- PlayerList.f.info("{}[{}] logged in with entity id {} at ({}, {}, {})", entityplayer.getDisplayName().getString(), s1, entityplayer.getId(), entityplayer.locX, entityplayer.locY, entityplayer.locZ);
+ // CraftBukkit - Moved message to after join
+ // PlayerList.f.info("{}[{}] logged in with entity id {} at ({}, {}, {})", entityplayer.getDisplayName().getString(), s1, Integer.valueOf(entityplayer.getId()), Double.valueOf(entityplayer.locX), Double.valueOf(entityplayer.locY), Double.valueOf(entityplayer.locZ));
+ // PlayerList.f.info("{}[{}] logged in with entity id {} at ({}, {}, {})", entityplayer.getDisplayName().getString(), s1, entityplayer.getId(), entityplayer.locX, entityplayer.locY, entityplayer.locZ);
WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension);
WorldData worlddata = worldserver.getWorldData();
@ -125,7 +125,7 @@
entityplayer.syncInventory();
+ // CraftBukkit - Moved from above, added world
+ PlayerList.f.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, Integer.valueOf(entityplayer.getId()), entityplayer.world.worldData.getName(), Double.valueOf(entityplayer.locX), Double.valueOf(entityplayer.locY), Double.valueOf(entityplayer.locZ));
+ PlayerList.f.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, entityplayer.getId(), entityplayer.world.worldData.getName(), entityplayer.locX, entityplayer.locY, entityplayer.locZ);
}
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
@ -235,12 +235,12 @@
- worldserver.addEntity(entityplayer);
- this.a(entityplayer, (WorldServer) null);
- this.server.aP().a(entityplayer);
- this.server.getBossBattleCustomData().a(entityplayer);
+ // CraftBukkit start - Only add if the player wasn't moved in the event
+ if (entityplayer.world == worldserver && !worldserver.players.contains(entityplayer)) {
+ worldserver.addEntity(entityplayer);
+ this.a(entityplayer, (WorldServer) null);
+ this.server.aP().a(entityplayer);
+ this.server.getBossBattleCustomData().a(entityplayer);
+ }
+ // CraftBukkit end
}

Datei anzeigen

@ -6,9 +6,9 @@
-public class RecipeFireworks extends IRecipeComplex {
+public class RecipeFireworks extends ShapelessRecipes implements IRecipe { // CraftBukkit - added extends
private static final RecipeItemStack a = RecipeItemStack.a(new IMaterial[] { Items.PAPER});
private static final RecipeItemStack b = RecipeItemStack.a(new IMaterial[] { Items.GUNPOWDER});
private static final RecipeItemStack c = RecipeItemStack.a(new IMaterial[] { Items.FIREWORK_STAR});
private static final RecipeItemStack a = RecipeItemStack.a(Items.PAPER);
private static final RecipeItemStack b = RecipeItemStack.a(Items.GUNPOWDER);
private static final RecipeItemStack c = RecipeItemStack.a(Items.FIREWORK_STAR);
+ // CraftBukkit start - Delegate to new parent class with bogus info
public RecipeFireworks(MinecraftKey minecraftkey) {

Datei anzeigen

@ -7,7 +7,7 @@
-public class RecipeFireworksFade extends IRecipeComplex {
+public class RecipeFireworksFade extends ShapelessRecipes implements IRecipe { // CraftBukkit - added extends
private static final RecipeItemStack a = RecipeItemStack.a(new IMaterial[] { Items.FIREWORK_STAR});
private static final RecipeItemStack a = RecipeItemStack.a(Items.FIREWORK_STAR);
+ // CraftBukkit start - Delegate to new parent class with bogus info
public RecipeFireworksFade(MinecraftKey minecraftkey) {

Datei anzeigen

@ -7,9 +7,9 @@
-public class RecipeFireworksStar extends IRecipeComplex {
+public class RecipeFireworksStar extends ShapelessRecipes implements IRecipe { // CraftBukkit - added extends
private static final RecipeItemStack a = RecipeItemStack.a(new IMaterial[] { Items.FIRE_CHARGE, Items.FEATHER, Items.GOLD_NUGGET, Items.SKELETON_SKULL, Items.WITHER_SKELETON_SKULL, Items.CREEPER_HEAD, Items.PLAYER_HEAD, Items.DRAGON_HEAD, Items.ZOMBIE_HEAD});
private static final RecipeItemStack b = RecipeItemStack.a(new IMaterial[] { Items.DIAMOND});
private static final RecipeItemStack c = RecipeItemStack.a(new IMaterial[] { Items.GLOWSTONE_DUST});
private static final RecipeItemStack a = RecipeItemStack.a(Items.FIRE_CHARGE, Items.FEATHER, Items.GOLD_NUGGET, Items.SKELETON_SKULL, Items.WITHER_SKELETON_SKULL, Items.CREEPER_HEAD, Items.PLAYER_HEAD, Items.DRAGON_HEAD, Items.ZOMBIE_HEAD);
private static final RecipeItemStack b = RecipeItemStack.a(Items.DIAMOND);
private static final RecipeItemStack c = RecipeItemStack.a(Items.GLOWSTONE_DUST);
- private static final Map<Item, ItemFireworks.EffectType> d = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
+ private static final Map<Item, ItemFireworks.EffectType> d = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
hashmap.put(Items.FIRE_CHARGE, ItemFireworks.EffectType.LARGE_BALL);
@ -17,7 +17,7 @@
hashmap.put(Items.GOLD_NUGGET, ItemFireworks.EffectType.STAR);
@@ -26,9 +26,11 @@
});
private static final RecipeItemStack e = RecipeItemStack.a(new IMaterial[] { Items.GUNPOWDER});
private static final RecipeItemStack e = RecipeItemStack.a(Items.GUNPOWDER);
+ // CraftBukkit start - Delegate to new parent class with bogus info
public RecipeFireworksStar(MinecraftKey minecraftkey) {

Datei anzeigen

@ -99,7 +99,7 @@
} else {
entityinsentient.die();
}
@@ -260,7 +296,7 @@
@@ -259,7 +295,7 @@
entityinsentient.setPositionRotation(d0, (double) blockposition.getY(), d1, random.nextFloat() * 360.0F, 0.0F);
if (entityinsentient.a(generatoraccess, false) && entityinsentient.a((IWorldReader) generatoraccess)) {
groupdataentity = entityinsentient.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityinsentient)), groupdataentity, (NBTTagCompound) null);

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