Archiviert
13
0

Minecraft 1.9.4

Dieser Commit ist enthalten in:
md_5 2016-05-10 21:47:39 +10:00
Ursprung 4cb32587ac
Commit c5e9a169fa
236 geänderte Dateien mit 1471 neuen und 1822 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Block.java
+++ b/net/minecraft/server/Block.java
@@ -34,7 +34,7 @@
@@ -35,7 +35,7 @@
private String name;
public static int getId(Block block) {
@ -9,7 +9,7 @@
}
public static int getCombinedId(IBlockData iblockdata) {
@@ -301,7 +301,8 @@
@@ -327,7 +327,8 @@
int j = this.getDropCount(i, world.random);
for (int k = 0; k < j; ++k) {
@ -19,7 +19,7 @@
Item item = this.getDropType(iblockdata, world.random, i);
if (item != null) {
@@ -825,7 +826,7 @@
@@ -863,7 +864,7 @@
if (hashset.contains(block16)) {
for (int i = 0; i < 15; ++i) {
@ -28,7 +28,7 @@
Block.REGISTRY_ID.a(block16.fromLegacyData(i), j);
}
@@ -834,7 +835,7 @@
@@ -872,7 +873,7 @@
while (iterator2.hasNext()) {
IBlockData iblockdata = (IBlockData) iterator2.next();
@ -37,7 +37,7 @@
Block.REGISTRY_ID.a(iblockdata, k);
}
@@ -843,6 +844,12 @@
@@ -881,6 +882,12 @@
}

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockButtonAbstract.java
+++ b/net/minecraft/server/BlockButtonAbstract.java
@@ -3,6 +3,11 @@
import java.util.List;
@@ -4,6 +4,11 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.event.block.BlockRedstoneEvent;
@ -12,7 +12,7 @@
public abstract class BlockButtonAbstract extends BlockDirectional {
public static final BlockStateBoolean POWERED = BlockStateBoolean.of("powered");
@@ -121,6 +126,19 @@
@@ -123,6 +128,19 @@
if (((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)).booleanValue()) {
return true;
} else {
@ -32,7 +32,7 @@
world.setTypeAndData(blockposition, iblockdata.set(BlockButtonAbstract.POWERED, Boolean.valueOf(true)), 3);
world.b(blockposition, blockposition);
this.a(entityhuman, world, blockposition);
@@ -162,6 +180,16 @@
@@ -164,6 +182,16 @@
if (this.I) {
this.e(iblockdata, world, blockposition);
} else {
@ -49,7 +49,7 @@
world.setTypeUpdate(blockposition, iblockdata.set(BlockButtonAbstract.POWERED, Boolean.valueOf(false)));
this.c(world, blockposition, (EnumDirection) iblockdata.get(BlockButtonAbstract.FACING));
this.b(world, blockposition);
@@ -187,7 +215,41 @@
@@ -189,7 +217,41 @@
boolean flag = !list.isEmpty();
boolean flag1 = ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)).booleanValue();
@ -91,7 +91,7 @@
world.setTypeUpdate(blockposition, iblockdata.set(BlockButtonAbstract.POWERED, Boolean.valueOf(true)));
this.c(world, blockposition, (EnumDirection) iblockdata.get(BlockButtonAbstract.FACING));
world.b(blockposition, blockposition);
@@ -195,6 +257,16 @@
@@ -197,6 +259,16 @@
}
if (!flag && flag1) {

Datei anzeigen

@ -19,7 +19,7 @@
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition1.getX(), blockposition1.getY(), blockposition1.getZ(), this, 0); // CraftBukkit
world.setTypeAndData(blockposition, iblockdata1, 4);
this.doPhysics(world, blockposition1, iblockdata1, this);
iblockdata1.doPhysics(world, blockposition1, this);
} else {
@@ -87,7 +90,9 @@
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockCake.java
+++ b/net/minecraft/server/BlockCake.java
@@ -33,7 +33,18 @@
@@ -34,7 +34,18 @@
private void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
if (entityhuman.l(false)) {
entityhuman.b(StatisticList.J);

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/BlockCauldron.java
+++ b/net/minecraft/server/BlockCauldron.java
@@ -2,6 +2,7 @@
@@ -3,6 +3,7 @@
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.CauldronLevelChangeEvent; // CraftBukkit
public class BlockCauldron extends Block {
@@ -42,8 +43,13 @@
@@ -43,8 +44,13 @@
float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F;
if (!world.isClientSide && entity.isBurning() && i > 0 && entity.getBoundingBox().b <= (double) f) {
@ -23,7 +23,7 @@
}
}
@@ -57,17 +63,26 @@
@@ -58,17 +64,26 @@
if (item == Items.WATER_BUCKET) {
if (i < 3 && !world.isClientSide) {
@ -51,7 +51,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
--itemstack.count;
if (itemstack.count == 0) {
@@ -78,7 +93,8 @@
@@ -79,7 +94,8 @@
}
entityhuman.b(StatisticList.L);
@ -61,7 +61,7 @@
}
return true;
@@ -87,6 +103,10 @@
@@ -88,6 +104,10 @@
if (item == Items.GLASS_BOTTLE) {
if (i > 0 && !world.isClientSide) {
@ -72,7 +72,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1 = PotionUtil.a(new ItemStack(Items.POTION), Potions.b);
entityhuman.b(StatisticList.L);
@@ -99,7 +119,8 @@
@@ -100,7 +120,8 @@
}
}
@ -82,7 +82,7 @@
}
return true;
@@ -108,8 +129,13 @@
@@ -109,8 +130,13 @@
ItemArmor itemarmor = (ItemArmor) item;
if (itemarmor.d() == ItemArmor.EnumArmorMaterial.LEATHER && itemarmor.e_(itemstack) && !world.isClientSide) {
@ -97,7 +97,7 @@
entityhuman.b(StatisticList.M);
return true;
}
@@ -134,7 +160,7 @@
@@ -135,7 +161,7 @@
}
if (!entityhuman.abilities.canInstantlyBuild) {
@ -106,7 +106,7 @@
}
}
@@ -147,9 +173,25 @@
@@ -148,9 +174,25 @@
}
}
@ -133,7 +133,7 @@
}
public void h(World world, BlockPosition blockposition) {
@@ -160,7 +202,7 @@
@@ -161,7 +203,7 @@
IBlockData iblockdata = world.getType(blockposition);
if (((Integer) iblockdata.get(BlockCauldron.LEVEL)).intValue() < 3) {

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockChorusFlower.java
+++ b/net/minecraft/server/BlockChorusFlower.java
@@ -3,6 +3,8 @@
import java.util.Iterator;
@@ -4,6 +4,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockChorusFlower extends Block {
public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 5);
@@ -66,8 +68,20 @@
@@ -68,8 +70,20 @@
}
if (flag && a(world, blockposition1, (EnumDirection) null) && world.isEmpty(blockposition.up(2))) {
@ -32,7 +32,7 @@
} else if (i < 4) {
j = random.nextInt(4);
boolean flag2 = false;
@@ -81,18 +95,53 @@
@@ -83,18 +97,53 @@
BlockPosition blockposition2 = blockposition.shift(enumdirection);
if (world.isEmpty(blockposition2) && world.isEmpty(blockposition2.down()) && a(world, blockposition2, enumdirection.opposite())) {

Datei anzeigen

@ -1,21 +1,20 @@
--- a/net/minecraft/server/BlockCommand.java
+++ b/net/minecraft/server/BlockCommand.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockCommand extends BlockTileEntity {
public static final BlockStateDirection a = BlockDirectional.FACING;
@@ -29,7 +31,17 @@
boolean flag1 = tileentitycommand.d();
boolean flag2 = tileentitycommand.e();
@@ -30,7 +32,16 @@
boolean flag1 = tileentitycommand.e();
boolean flag2 = tileentitycommand.g();
- if (flag && !flag1) {
+ // CraftBukkit start
+ // PAIL: This section - renames, ordering
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ int old = flag1 ? 15 : 0;
+ int current = flag ? 15 : 0;
@ -26,9 +25,9 @@
+
+ if (eventRedstone.getNewCurrent() > 0 && !(eventRedstone.getOldCurrent() > 0)) { // CraftBukkit
tileentitycommand.a(true);
if (tileentitycommand.i() != TileEntityCommand.Type.SEQUENCE && !flag2) {
boolean flag3 = !tileentitycommand.j() || this.e(world, blockposition, iblockdata);
@@ -40,7 +52,7 @@
if (tileentitycommand.j() != TileEntityCommand.Type.SEQUENCE && !flag2) {
boolean flag3 = !tileentitycommand.k() || this.e(world, blockposition, iblockdata);
@@ -41,7 +52,7 @@
this.c(world, blockposition);
}
}

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockCrops.java
+++ b/net/minecraft/server/BlockCrops.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 7);
@@ -53,7 +55,10 @@
@@ -54,7 +56,10 @@
float f = a((Block) this, world, blockposition);
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
@ -21,7 +21,7 @@
}
}
}
@@ -68,7 +73,10 @@
@@ -69,7 +74,10 @@
i = j;
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockDaylightDetector.java
+++ b/net/minecraft/server/BlockDaylightDetector.java
@@ -45,6 +45,7 @@
@@ -46,6 +46,7 @@
i = MathHelper.clamp(i, 0, 15);
if (((Integer) iblockdata.get(BlockDaylightDetector.POWER)).intValue() != i) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockDispenser.java
+++ b/net/minecraft/server/BlockDispenser.java
@@ -8,6 +8,7 @@
@@ -9,6 +9,7 @@
public static final BlockStateBoolean TRIGGERED = BlockStateBoolean.of("triggered");
public static final RegistryDefault<Item, IDispenseBehavior> REGISTRY = new RegistryDefault(new DispenseBehaviorItem());
protected Random d = new Random();
@ -8,7 +8,7 @@
protected BlockDispenser() {
super(Material.STONE);
@@ -83,6 +84,7 @@
@@ -84,6 +85,7 @@
if (idispensebehavior != IDispenseBehavior.NONE) {
ItemStack itemstack1 = idispensebehavior.a(sourceblock, itemstack);

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockDoor.java
+++ b/net/minecraft/server/BlockDoor.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockDoor extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@@ -137,9 +139,22 @@
@@ -138,9 +140,22 @@
this.b(world, blockposition, iblockdata, 0);
}
} else {
@ -34,7 +34,7 @@
world.setTypeAndData(blockposition2, iblockdata2.set(BlockDoor.POWERED, Boolean.valueOf(flag1)), 2);
if (flag1 != ((Boolean) iblockdata.get(BlockDoor.OPEN)).booleanValue()) {
world.setTypeAndData(blockposition, iblockdata.set(BlockDoor.OPEN, Boolean.valueOf(flag1)), 2);
@@ -147,6 +162,7 @@
@@ -148,6 +163,7 @@
world.a((EntityHuman) null, flag1 ? this.g() : this.e(), blockposition, 0);
}
}

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockDragonEgg.java
+++ b/net/minecraft/server/BlockDragonEgg.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit
+
public class BlockDragonEgg extends Block {
protected static final AxisAlignedBB a = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 1.0D, 0.9375D);
@@ -66,6 +68,18 @@
@@ -67,6 +69,18 @@
BlockPosition blockposition1 = blockposition.a(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16));
if (world.getType(blockposition1).getBlock().material == Material.AIR) {

Datei anzeigen

@ -1,17 +1,17 @@
--- a/net/minecraft/server/BlockDropper.java
+++ b/net/minecraft/server/BlockDropper.java
@@ -1,5 +1,10 @@
@@ -1,6 +1,10 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.inventory.InventoryMoveItemEvent;
+// CraftBukkit end
+
public class BlockDropper extends BlockDispenser {
private final IDispenseBehavior e = new DispenseBehaviorItem();
@@ -38,8 +43,25 @@
@@ -40,8 +44,25 @@
itemstack1 = null;
}
} else {

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockEnderPortal.java
+++ b/net/minecraft/server/BlockEnderPortal.java
@@ -3,6 +3,8 @@
import java.util.List;
@@ -4,6 +4,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
+
public class BlockEnderPortal extends BlockTileEntity {
protected static final AxisAlignedBB a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D);
@@ -36,6 +38,10 @@
@@ -37,6 +39,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.aV() && !world.isClientSide && entity.getBoundingBox().b(iblockdata.c(world, blockposition).a(blockposition))) {

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockFire.java
+++ b/net/minecraft/server/BlockFire.java
@@ -4,6 +4,12 @@
import java.util.Map;
@@ -5,6 +5,12 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@ -13,7 +13,7 @@
public class BlockFire extends Block {
public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 15);
@@ -93,7 +99,7 @@
@@ -95,7 +101,7 @@
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
if (world.getGameRules().getBoolean("doFireTick")) {
if (!this.canPlace(world, blockposition)) {
@ -22,7 +22,7 @@
}
Block block = world.getType(blockposition.down()).getBlock();
@@ -106,7 +112,7 @@
@@ -108,7 +114,7 @@
int i = ((Integer) iblockdata.get(BlockFire.AGE)).intValue();
if (!flag && world.W() && this.b(world, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) {
@ -31,7 +31,7 @@
} else {
if (i < 15) {
iblockdata = iblockdata.set(BlockFire.AGE, Integer.valueOf(i + random.nextInt(3) / 2));
@@ -117,14 +123,14 @@
@@ -119,14 +125,14 @@
if (!flag) {
if (!this.c(world, blockposition)) {
if (!world.getType(blockposition.down()).q() || i > 3) {
@ -48,7 +48,7 @@
return;
}
}
@@ -170,7 +176,26 @@
@@ -172,7 +178,26 @@
l1 = 15;
}
@ -76,7 +76,7 @@
}
}
}
@@ -208,6 +233,17 @@
@@ -210,6 +235,17 @@
if (random.nextInt(i) < k) {
IBlockData iblockdata = world.getType(blockposition);
@ -94,7 +94,7 @@
if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
int l = j + random.nextInt(5) / 4;
@@ -217,7 +253,7 @@
@@ -219,7 +255,7 @@
world.setTypeAndData(blockposition, this.getBlockData().set(BlockFire.AGE, Integer.valueOf(l)), 3);
} else {
@ -103,16 +103,16 @@
}
if (iblockdata.getBlock() == Blocks.TNT) {
@@ -274,7 +310,7 @@
@@ -276,7 +312,7 @@
public void doPhysics(World world, BlockPosition blockposition, IBlockData iblockdata, Block block) {
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Block block) {
if (!world.getType(blockposition.down()).q() && !this.c(world, blockposition)) {
- world.setAir(blockposition);
+ fireExtinguished(world, blockposition); // CraftBukkit - fuel block gone
}
}
@@ -282,7 +318,7 @@
@@ -284,7 +320,7 @@
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
if (world.worldProvider.getDimensionManager().getDimensionID() > 0 || !Blocks.PORTAL.b(world, blockposition)) {
if (!world.getType(blockposition.down()).q() && !this.c(world, blockposition)) {
@ -121,7 +121,7 @@
} else {
world.a(blockposition, (Block) this, this.a(world) + world.random.nextInt(10));
}
@@ -304,4 +340,12 @@
@@ -306,4 +342,12 @@
protected BlockStateList getStateList() {
return new BlockStateList(this, new IBlockState[] { BlockFire.AGE, BlockFire.NORTH, BlockFire.EAST, BlockFire.SOUTH, BlockFire.WEST, BlockFire.UPPER});
}

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockGrass.java
+++ b/net/minecraft/server/BlockGrass.java
@@ -2,6 +2,14 @@
@@ -3,6 +3,14 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.block.BlockState;
@ -15,7 +15,7 @@
public class BlockGrass extends Block implements IBlockFragilePlantElement {
public static final BlockStateBoolean SNOWY = BlockStateBoolean.of("snowy");
@@ -22,7 +30,19 @@
@@ -23,7 +31,19 @@
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
if (!world.isClientSide) {
if (world.getLightLevel(blockposition.up()) < 4 && world.getType(blockposition.up()).c() > 2) {
@ -36,7 +36,7 @@
} else {
if (world.getLightLevel(blockposition.up()) >= 9) {
for (int i = 0; i < 4; ++i) {
@@ -36,7 +56,19 @@
@@ -37,7 +57,19 @@
IBlockData iblockdata2 = world.getType(blockposition1);
if (iblockdata2.getBlock() == Blocks.DIRT && iblockdata2.get(BlockDirt.VARIANT) == BlockDirt.EnumDirtVariant.DIRT && world.getLightLevel(blockposition1.up()) >= 4 && iblockdata1.c() <= 2) {
@ -57,7 +57,7 @@
}
}
}
@@ -79,13 +111,15 @@
@@ -81,13 +113,15 @@
IBlockData iblockdata1 = blockflowers.getBlockData().set(blockflowers.g(), blockflowers_enumflowervarient);
if (blockflowers.f(world, blockposition2, iblockdata1)) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockIce.java
+++ b/net/minecraft/server/BlockIce.java
@@ -50,6 +50,11 @@
@@ -51,6 +51,11 @@
}
protected void b(World world, BlockPosition blockposition) {

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/BlockJukeBox.java
+++ b/net/minecraft/server/BlockJukeBox.java
@@ -136,6 +136,11 @@
@@ -140,6 +140,11 @@
}
public void setRecord(ItemStack itemstack) {
public void setRecord(@Nullable ItemStack itemstack) {
+ // CraftBukkit start - There can only be one
+ if (itemstack != null) {
+ itemstack.count = 1;

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockLeaves.java
+++ b/net/minecraft/server/BlockLeaves.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
+
public abstract class BlockLeaves extends Block {
public static final BlockStateBoolean DECAYABLE = BlockStateBoolean.of("decayable");
@@ -132,6 +134,14 @@
@@ -133,6 +135,14 @@
}
private void b(World world, BlockPosition blockposition) {

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockLever.java
+++ b/net/minecraft/server/BlockLever.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import java.util.Iterator;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockLever extends Block {
public static final BlockStateEnum<BlockLever.EnumLeverPosition> FACING = BlockStateEnum.of("facing", BlockLever.EnumLeverPosition.class);
@@ -127,6 +129,20 @@
@@ -129,6 +131,20 @@
if (world.isClientSide) {
return true;
} else {

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockMinecartDetector.java
+++ b/net/minecraft/server/BlockMinecartDetector.java
@@ -5,6 +5,8 @@
import java.util.List;
@@ -6,6 +6,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
public static final BlockStateEnum<BlockMinecartTrackAbstract.EnumTrackPosition> SHAPE = BlockStateEnum.a("shape", BlockMinecartTrackAbstract.EnumTrackPosition.class, new Predicate() {
@@ -65,6 +67,17 @@
@@ -66,6 +68,17 @@
flag1 = true;
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockMinecartTrackAbstract.java
+++ b/net/minecraft/server/BlockMinecartTrackAbstract.java
@@ -10,6 +10,7 @@
@@ -11,6 +11,7 @@
protected static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.15625D, 1.0D);
protected final boolean c;

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockMobSpawner.java
+++ b/net/minecraft/server/BlockMobSpawner.java
@@ -22,9 +22,19 @@
@@ -24,9 +24,19 @@
public void dropNaturally(World world, BlockPosition blockposition, IBlockData iblockdata, float f, int i) {
super.dropNaturally(world, blockposition, iblockdata, f, i);

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockMycel.java
+++ b/net/minecraft/server/BlockMycel.java
@@ -2,6 +2,13 @@
@@ -3,6 +3,13 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.block.BlockState;
@ -14,7 +14,7 @@
public class BlockMycel extends Block {
public static final BlockStateBoolean SNOWY = BlockStateBoolean.of("snowy");
@@ -22,7 +29,19 @@
@@ -23,7 +30,19 @@
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
if (!world.isClientSide) {
if (world.getLightLevel(blockposition.up()) < 4 && world.getType(blockposition.up()).c() > 2) {
@ -35,7 +35,7 @@
} else {
if (world.getLightLevel(blockposition.up()) >= 9) {
for (int i = 0; i < 4; ++i) {
@@ -31,7 +50,19 @@
@@ -32,7 +51,19 @@
IBlockData iblockdata2 = world.getType(blockposition1.up());
if (iblockdata1.getBlock() == Blocks.DIRT && iblockdata1.get(BlockDirt.VARIANT) == BlockDirt.EnumDirtVariant.DIRT && world.getLightLevel(blockposition1.up()) >= 4 && iblockdata2.c() <= 2) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockNetherWart.java
+++ b/net/minecraft/server/BlockNetherWart.java
@@ -31,7 +31,8 @@
@@ -32,7 +32,8 @@
if (i < 3 && random.nextInt(10) == 0) {
iblockdata = iblockdata.set(BlockNetherWart.AGE, Integer.valueOf(i + 1));

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockOre.java
+++ b/net/minecraft/server/BlockOre.java
@@ -37,6 +37,7 @@
@@ -39,6 +39,7 @@
public void dropNaturally(World world, BlockPosition blockposition, IBlockData iblockdata, float f, int i) {
super.dropNaturally(world, blockposition, iblockdata, f, i);
@ -8,7 +8,7 @@
if (this.getDropType(iblockdata, world.random, i) != Item.getItemOf(this)) {
int j = 0;
@@ -54,13 +55,42 @@
@@ -56,13 +57,42 @@
this.dropExperience(world, blockposition, j);
}

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockPiston.java
+++ b/net/minecraft/server/BlockPiston.java
@@ -4,6 +4,18 @@
import java.util.ArrayList;
@@ -5,6 +5,18 @@
import java.util.List;
import javax.annotation.Nullable;
+// CraftBukkit start
+import java.util.AbstractList;
@ -19,7 +19,7 @@
public class BlockPiston extends BlockDirectional {
public static final BlockStateBoolean EXTENDED = BlockStateBoolean.of("extended");
@@ -98,6 +110,18 @@
@@ -99,6 +111,18 @@
world.playBlockAction(blockposition, this, 0, enumdirection.a());
}
} else if (!flag && ((Boolean) iblockdata.get(BlockPiston.EXTENDED)).booleanValue()) {
@ -38,7 +38,7 @@
world.playBlockAction(blockposition, this, 1, enumdirection.a());
}
@@ -188,7 +212,7 @@
@@ -189,7 +213,7 @@
}
}
@ -47,7 +47,7 @@
this.a(world, blockposition, enumdirection, false);
}
} else {
@@ -284,6 +308,48 @@
@@ -286,6 +310,48 @@
int j = list.size() + list1.size();
IBlockData[] aiblockdata = new IBlockData[j];
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite();

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/BlockPlant.java
+++ b/net/minecraft/server/BlockPlant.java
@@ -1,6 +1,10 @@
package net.minecraft.server;
@@ -2,6 +2,10 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.event.block.BlockPhysicsEvent;
@ -11,7 +11,7 @@
public class BlockPlant extends Block {
@@ -39,6 +43,15 @@
@@ -40,6 +44,15 @@
protected void e(World world, BlockPosition blockposition, IBlockData iblockdata) {
if (!this.f(world, blockposition, iblockdata)) {

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockPortal.java
+++ b/net/minecraft/server/BlockPortal.java
@@ -3,6 +3,9 @@
import com.google.common.cache.LoadingCache;
@@ -4,6 +4,9 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
+import org.bukkit.event.world.PortalCreateEvent; // CraftBukkit
@ -10,7 +10,7 @@
public class BlockPortal extends BlockHalfTransparent {
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockStateEnum.of("axis", EnumDirection.EnumAxis.class, new EnumDirection.EnumAxis[] { EnumDirection.EnumAxis.X, EnumDirection.EnumAxis.Z});
@@ -42,7 +45,8 @@
@@ -43,7 +46,8 @@
}
if (i > 0 && !world.getType(blockposition1.up()).l()) {
@ -20,7 +20,7 @@
if (entity != null) {
entity.portalCooldown = entity.aC();
@@ -68,14 +72,16 @@
@@ -70,14 +74,16 @@
BlockPortal.Shape blockportal_shape = new BlockPortal.Shape(world, blockposition, EnumDirection.EnumAxis.X);
if (blockportal_shape.d() && blockportal_shape.e == 0) {
@ -41,7 +41,7 @@
} else {
return false;
}
@@ -106,6 +112,10 @@
@@ -108,6 +114,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.aV()) {
@ -52,7 +52,7 @@
entity.e(blockposition);
}
@@ -251,6 +261,7 @@
@@ -254,6 +264,7 @@
private BlockPosition position;
private int height;
private int width;
@ -60,7 +60,7 @@
public Shape(World world, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
this.a = world;
@@ -309,6 +320,10 @@
@@ -312,6 +323,10 @@
}
protected int c() {
@ -71,7 +71,7 @@
int i;
label56:
@@ -329,11 +344,21 @@
@@ -332,11 +347,21 @@
block = this.a.getType(blockposition.shift(this.d)).getBlock();
if (block != Blocks.OBSIDIAN) {
break label56;
@ -93,7 +93,7 @@
}
}
}
@@ -343,6 +368,11 @@
@@ -346,6 +371,11 @@
if (this.a.getType(this.position.shift(this.c, i).up(this.height)).getBlock() != Blocks.OBSIDIAN) {
this.height = 0;
break;
@ -105,7 +105,7 @@
}
}
@@ -364,7 +394,27 @@
@@ -367,7 +397,27 @@
return this.position != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
}
@ -134,7 +134,7 @@
for (int i = 0; i < this.width; ++i) {
BlockPosition blockposition = this.position.shift(this.c, i);
@@ -373,6 +423,7 @@
@@ -376,6 +426,7 @@
}
}

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockPoweredRail.java
+++ b/net/minecraft/server/BlockPoweredRail.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import com.google.common.base.Predicate;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockPoweredRail extends BlockMinecartTrackAbstract {
public static final BlockStateEnum<BlockMinecartTrackAbstract.EnumTrackPosition> SHAPE = BlockStateEnum.a("shape", BlockMinecartTrackAbstract.EnumTrackPosition.class, new Predicate() {
@@ -116,6 +118,13 @@
@@ -117,6 +119,13 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || this.a(world, blockposition, iblockdata, true, 0) || this.a(world, blockposition, iblockdata, false, 0);
if (flag1 != flag) {

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockPressurePlateAbstract.java
+++ b/net/minecraft/server/BlockPressurePlateAbstract.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public abstract class BlockPressurePlateAbstract extends Block {
protected static final AxisAlignedBB a = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.03125D, 0.9375D);
@@ -93,6 +95,19 @@
@@ -95,6 +97,19 @@
boolean flag = i > 0;
boolean flag1 = j > 0;

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockPumpkin.java
+++ b/net/minecraft/server/BlockPumpkin.java
@@ -2,6 +2,12 @@
@@ -3,6 +3,12 @@
import com.google.common.base.Predicate;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
@ -13,7 +13,7 @@
public class BlockPumpkin extends BlockFacingHorizontal {
private ShapeDetector snowGolemPart;
@@ -40,17 +46,24 @@
@@ -41,17 +47,24 @@
int j;
if ((shapedetector_shapedetectorcollection = this.getDetectorSnowGolem().a(world, blockposition)) != null) {
@ -40,7 +40,7 @@
for (j = 0; j < 120; ++j) {
world.addParticle(EnumParticle.SNOW_SHOVEL, (double) blockposition1.getX() + world.random.nextDouble(), (double) blockposition1.getY() + world.random.nextDouble() * 2.5D, (double) blockposition1.getZ() + world.random.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
@@ -61,10 +74,16 @@
@@ -62,10 +75,16 @@
world.update(shapedetectorblock1.getPosition(), Blocks.AIR);
}
@ -58,7 +58,7 @@
}
}
@@ -73,7 +92,10 @@
@@ -74,7 +93,10 @@
entityirongolem.setPlayerCreated(true);
entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F);
@ -70,7 +70,7 @@
for (j = 0; j < 120; ++j) {
world.addParticle(EnumParticle.SNOWBALL, (double) blockposition2.getX() + world.random.nextDouble(), (double) blockposition2.getY() + world.random.nextDouble() * 3.9D, (double) blockposition2.getZ() + world.random.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
@@ -86,6 +108,7 @@
@@ -87,6 +109,7 @@
world.update(shapedetectorblock2.getPosition(), Blocks.AIR);
}
}

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockRedstoneLamp.java
+++ b/net/minecraft/server/BlockRedstoneLamp.java
@@ -2,6 +2,8 @@
@@ -3,6 +3,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockRedstoneLamp extends Block {
private final boolean a;
@@ -20,6 +22,11 @@
@@ -21,6 +23,11 @@
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
world.setTypeAndData(blockposition, Blocks.REDSTONE_LAMP.getBlockData(), 2);
} else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
@ -21,7 +21,7 @@
world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
}
@@ -31,6 +38,11 @@
@@ -32,6 +39,11 @@
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
world.a(blockposition, (Block) this, 4);
} else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
@ -33,7 +33,7 @@
world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
}
@@ -40,6 +52,11 @@
@@ -41,6 +53,11 @@
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
if (!world.isClientSide) {
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockRedstoneOre.java
+++ b/net/minecraft/server/BlockRedstoneOre.java
@@ -2,6 +2,11 @@
@@ -3,6 +3,11 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@ -12,7 +12,7 @@
public class BlockRedstoneOre extends Block {
private final boolean a;
@@ -20,23 +25,46 @@
@@ -21,23 +26,45 @@
}
public void attack(World world, BlockPosition blockposition, EntityHuman entityhuman) {
@ -25,7 +25,6 @@
- this.interact(world, blockposition);
- super.stepOn(world, blockposition, entity);
+ // CraftBukkit start
+ // PAIL: Rename this method
+ // this.interact(world, blockposition);
+ // super.stepOn(world, blockposition, entity);
+ if (entity instanceof EntityHuman) {
@ -46,7 +45,7 @@
}
+
public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) {
public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) {
- this.interact(world, blockposition);
+ this.interact(world, blockposition, entityhuman); // CraftBukkit - add entityhuman
return super.interact(world, blockposition, iblockdata, entityhuman, enumhand, itemstack, enumdirection, f, f1, f2);
@ -64,7 +63,7 @@
world.setTypeUpdate(blockposition, Blocks.LIT_REDSTONE_ORE.getBlockData());
}
@@ -44,6 +72,11 @@
@@ -45,6 +72,11 @@
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
if (this == Blocks.LIT_REDSTONE_ORE) {
@ -76,7 +75,7 @@
world.setTypeUpdate(blockposition, Blocks.REDSTONE_ORE.getBlockData());
}
@@ -63,12 +96,24 @@
@@ -65,12 +97,25 @@
public void dropNaturally(World world, BlockPosition blockposition, IBlockData iblockdata, float f, int i) {
super.dropNaturally(world, blockposition, iblockdata, f, i);
@ -87,13 +86,14 @@
this.dropExperience(world, blockposition, j);
}
+ // */
+
+ }
+
+ @Override
+ public int getExpDrop(World world, IBlockData data, int i) {
+ if (this.getDropType(data, world.random, i) != Item.getItemOf(this)) {
+ int j = 1 + world.random.nextInt(5);
+
+ return j;
+ }
+ return 0;

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockRedstoneTorch.java
+++ b/net/minecraft/server/BlockRedstoneTorch.java
@@ -6,6 +6,8 @@
import java.util.Map;
@@ -7,6 +7,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneTorch extends BlockTorch {
private static Map<World, List<BlockRedstoneTorch.RedstoneUpdateInfo>> g = Maps.newHashMap();
@@ -13,7 +15,7 @@
@@ -14,7 +16,7 @@
private boolean a(World world, BlockPosition blockposition, boolean flag) {
if (!BlockRedstoneTorch.g.containsKey(world)) {
@ -18,7 +18,7 @@
}
List list = (List) BlockRedstoneTorch.g.get(world);
@@ -96,8 +98,25 @@
@@ -97,8 +99,25 @@
list.remove(0);
}
@ -44,7 +44,7 @@
world.setTypeAndData(blockposition, Blocks.UNLIT_REDSTONE_TORCH.getBlockData().set(BlockRedstoneTorch.FACING, iblockdata.get(BlockRedstoneTorch.FACING)), 3);
if (this.a(world, blockposition, true)) {
world.a((EntityHuman) null, blockposition, SoundEffects.eG, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
@@ -114,6 +133,15 @@
@@ -115,6 +134,15 @@
}
}
} else if (!flag && !this.a(world, blockposition, false)) {

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockRedstoneWire.java
+++ b/net/minecraft/server/BlockRedstoneWire.java
@@ -8,6 +8,8 @@
import java.util.Random;
@@ -9,6 +9,8 @@
import java.util.Set;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneWire extends Block {
public static final BlockStateEnum<BlockRedstoneWire.EnumRedstoneWireConnection> NORTH = BlockStateEnum.of("north", BlockRedstoneWire.EnumRedstoneWireConnection.class);
@@ -166,6 +168,15 @@
@@ -168,6 +170,15 @@
j = k;
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockReed.java
+++ b/net/minecraft/server/BlockReed.java
@@ -31,8 +31,12 @@
@@ -32,8 +32,12 @@
int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue();
if (j == 15) {

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockSkull.java
+++ b/net/minecraft/server/BlockSkull.java
@@ -4,6 +4,11 @@
import java.util.Iterator;
@@ -5,6 +5,11 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
@ -12,7 +12,7 @@
public class BlockSkull extends BlockTileEntity {
public static final BlockStateDirection FACING = BlockDirectional.FACING;
@@ -81,7 +86,25 @@
@@ -82,7 +87,25 @@
return new ItemStack(Items.SKULL, 1, i);
}
@ -39,7 +39,7 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
if (entityhuman.abilities.canInstantlyBuild) {
@@ -94,7 +117,10 @@
@@ -95,7 +118,10 @@
public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) {
if (!world.isClientSide) {
@ -51,7 +51,7 @@
TileEntity tileentity = world.getTileEntity(blockposition);
if (tileentity instanceof TileEntitySkull) {
@@ -126,24 +152,36 @@
@@ -128,24 +154,36 @@
}
public void a(World world, BlockPosition blockposition, TileEntitySkull tileentityskull) {
@ -90,7 +90,7 @@
}
}
@@ -156,14 +194,16 @@
@@ -158,14 +196,16 @@
entitywither.o();
Iterator iterator = world.a(EntityHuman.class, entitywither.getBoundingBox().g(50.0D)).iterator();
@ -109,7 +109,7 @@
int k;
for (k = 0; k < 120; ++k) {
@@ -177,6 +217,7 @@
@@ -179,6 +219,7 @@
world.update(shapedetectorblock2.getPosition(), Blocks.AIR);
}
}

Datei anzeigen

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

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockSoil.java
+++ b/net/minecraft/server/BlockSoil.java
@@ -3,6 +3,11 @@
import java.util.Iterator;
@@ -4,6 +4,11 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityInteractEvent;
@ -12,7 +12,7 @@
public class BlockSoil extends Block {
public static final BlockStateInteger MOISTURE = BlockStateInteger.of("moisture", 0, 7);
@@ -38,6 +43,12 @@
@@ -40,6 +45,12 @@
if (i > 0) {
world.setTypeAndData(blockposition, iblockdata.set(BlockSoil.MOISTURE, Integer.valueOf(i - 1)), 2);
} else if (!this.b(world, blockposition)) {
@ -25,7 +25,7 @@
world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
}
} else if (i < 7) {
@@ -47,11 +58,31 @@
@@ -49,11 +60,31 @@
}
public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) {

Datei anzeigen

@ -23,11 +23,9 @@
world.setTypeUpdate(blockposition1, Blocks.FIRE.getBlockData());
return;
}
@@ -60,7 +69,16 @@
return;
@@ -61,6 +70,14 @@
}
+ // PAIL: rename
if (world.isEmpty(blockposition2.up()) && this.d(world, blockposition2)) {
+ // CraftBukkit start - Prevent lava putting something on fire
+ BlockPosition up = blockposition2.up();

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockStem.java
+++ b/net/minecraft/server/BlockStem.java
@@ -3,6 +3,8 @@
import java.util.Iterator;
@@ -4,6 +4,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 7);
@@ -53,7 +55,8 @@
@@ -54,7 +56,8 @@
if (i < 7) {
iblockdata = iblockdata.set(BlockStem.AGE, Integer.valueOf(i + 1));
@ -19,7 +19,7 @@
} else {
Iterator iterator = EnumDirection.EnumDirectionLimit.HORIZONTAL.iterator();
@@ -69,7 +72,8 @@
@@ -70,7 +73,8 @@
Block block = world.getType(blockposition.down()).getBlock();
if (world.getType(blockposition).getBlock().material == Material.AIR && (block == Blocks.FARMLAND || block == Blocks.DIRT || block == Blocks.GRASS)) {
@ -29,7 +29,7 @@
}
}
}
@@ -80,7 +84,8 @@
@@ -81,7 +85,8 @@
public void g(World world, BlockPosition blockposition, IBlockData iblockdata) {
int i = ((Integer) iblockdata.get(BlockStem.AGE)).intValue() + MathHelper.nextInt(world.random, 2, 5);

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/BlockTrapdoor.java
+++ b/net/minecraft/server/BlockTrapdoor.java
@@ -1,5 +1,7 @@
@@ -1,6 +1,7 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTrapdoor extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@@ -92,6 +94,19 @@
@@ -94,6 +95,19 @@
boolean flag = world.isBlockIndirectlyPowered(blockposition);
if (flag || block.getBlockData().m()) {

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockTripwire.java
+++ b/net/minecraft/server/BlockTripwire.java
@@ -4,6 +4,8 @@
import java.util.List;
@@ -5,6 +5,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
+
public class BlockTripwire extends Block {
public static final BlockStateBoolean POWERED = BlockStateBoolean.of("powered");
@@ -136,6 +138,40 @@
@@ -139,6 +141,40 @@
}
}

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockTripwireHook.java
+++ b/net/minecraft/server/BlockTripwireHook.java
@@ -4,6 +4,8 @@
import java.util.Iterator;
@@ -5,6 +5,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTripwireHook extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@@ -153,6 +155,17 @@
@@ -155,6 +157,17 @@
this.a(world, blockposition1, flag4, flag5, flag2, flag3);
}

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/BlockVine.java
+++ b/net/minecraft/server/BlockVine.java
@@ -3,6 +3,8 @@
import java.util.Iterator;
@@ -4,6 +4,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockVine extends Block {
public static final BlockStateBoolean UP = BlockStateBoolean.of("up");
@@ -172,7 +174,13 @@
@@ -174,7 +176,13 @@
}
if (((Boolean) iblockdata1.get(BlockVine.NORTH)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.EAST)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.SOUTH)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.WEST)).booleanValue()) {
@ -24,7 +24,7 @@
}
}
@@ -194,17 +202,29 @@
@@ -196,17 +204,29 @@
BlockPosition blockposition3 = blockposition2.shift(enumdirection2);
BlockPosition blockposition4 = blockposition2.shift(enumdirection3);
@ -59,7 +59,7 @@
} else if (block.material.k() && iblockdata2.h()) {
world.setTypeAndData(blockposition, iblockdata.set(getDirection(enumdirection), Boolean.valueOf(true)), 2);
}
@@ -231,7 +251,12 @@
@@ -233,7 +253,12 @@
}
if (((Boolean) iblockdata3.get(BlockVine.NORTH)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.EAST)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.SOUTH)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.WEST)).booleanValue()) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockWaterLily.java
+++ b/net/minecraft/server/BlockWaterLily.java
@@ -19,7 +19,7 @@
@@ -20,7 +20,7 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
super.a(world, blockposition, iblockdata, entity);

Datei anzeigen

@ -1,11 +0,0 @@
--- a/net/minecraft/server/BossBattleServer.java
+++ b/net/minecraft/server/BossBattleServer.java
@@ -10,7 +10,7 @@
private final Set<EntityPlayer> h = Sets.newHashSet();
private final Set<EntityPlayer> i;
- private boolean j;
+ public boolean j; // PAIL: rename / public
public BossBattleServer(IChatBaseComponent ichatbasecomponent, BossBattle.BarColor bossbattle_barcolor, BossBattle.BarStyle bossbattle_barstyle) {
super(MathHelper.a(), ichatbasecomponent, bossbattle_barcolor, bossbattle_barstyle);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChatBaseComponent.java
+++ b/net/minecraft/server/ChatBaseComponent.java
@@ -111,7 +111,7 @@
@@ -112,7 +112,7 @@
}
public int hashCode() {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChatModifier.java
+++ b/net/minecraft/server/ChatModifier.java
@@ -254,16 +254,18 @@
@@ -263,16 +263,18 @@
}
public int hashCode() {
@ -28,7 +28,7 @@
return i;
}
@@ -429,11 +431,11 @@
@@ -440,11 +442,11 @@
}
}

Datei anzeigen

@ -9,10 +9,10 @@
+
public class Chunk {
private static final Logger d = LogManager.getLogger();
@@ -41,6 +44,34 @@
private int w;
private ConcurrentLinkedQueue<BlockPosition> x;
private static final Logger e = LogManager.getLogger();
@@ -42,6 +45,34 @@
private ConcurrentLinkedQueue<BlockPosition> y;
public boolean d;
+ // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking
+ private int neighbors = 0x1 << 12;
@ -44,12 +44,11 @@
+
public Chunk(World world, int i, int j) {
this.sections = new ChunkSection[16];
this.f = new byte[256];
@@ -61,8 +92,15 @@
this.g = new byte[256];
@@ -62,8 +93,14 @@
Arrays.fill(this.g, -999);
Arrays.fill(this.f, (byte) -1);
+
Arrays.fill(this.h, -999);
Arrays.fill(this.g, (byte) -1);
+ // CraftBukkit start
+ this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);
}
@ -61,7 +60,7 @@
public Chunk(World world, ChunkSnapshot chunksnapshot, int i, int j) {
this(world, i, j);
short short0 = 256;
@@ -463,7 +501,8 @@
@@ -466,7 +503,8 @@
}
}
@ -71,22 +70,22 @@
block.onPlace(this.world, blockposition, iblockdata);
}
@@ -544,7 +583,11 @@
@@ -547,7 +585,11 @@
int j = MathHelper.floor(entity.locZ / 16.0D);
if (i != this.locX || j != this.locZ) {
- Chunk.d.warn("Wrong location! (" + i + ", " + j + ") should be (" + this.locX + ", " + this.locZ + "), " + entity, new Object[] { entity});
- Chunk.e.warn("Wrong location! (" + i + ", " + j + ") should be (" + this.locX + ", " + this.locZ + "), " + entity, new Object[] { entity});
+ // CraftBukkit start
+ Bukkit.getLogger().warning("Wrong location for " + entity + " in world '" + world.getWorld().getName() + "'!");
+ // Chunk.d.warn("Wrong location! (" + i + ", " + j + ") should be (" + this.locX + ", " + this.locZ + "), " + entity, new Object[] { entity});
+ // Chunk.e.warn("Wrong location! (" + i + ", " + j + ") should be (" + this.locX + ", " + this.locZ + "), " + entity, new Object[] { entity});
+ Bukkit.getLogger().warning("Entity is at " + entity.locX + "," + entity.locZ + " (chunk " + i + "," + j + ") but was stored in chunk " + this.locX + "," + this.locZ);
+ // CraftBukkit end
entity.die();
}
@@ -597,7 +640,15 @@
}
@@ -602,7 +644,15 @@
@Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
- TileEntity tileentity = (TileEntity) this.tileEntities.get(blockposition);
+ // CraftBukkit start
@ -101,7 +100,7 @@
if (tileentity == null) {
if (chunk_enumtileentitystate == Chunk.EnumTileEntityState.IMMEDIATE) {
@@ -632,6 +683,13 @@
@@ -637,6 +687,13 @@
tileentity.z();
this.tileEntities.put(blockposition, tileentity);
@ -115,7 +114,7 @@
}
}
@@ -675,7 +733,21 @@
@@ -680,7 +737,21 @@
}
for (int i = 0; i < this.entitySlices.length; ++i) {
@ -138,7 +137,7 @@
}
}
@@ -733,8 +805,8 @@
@@ -738,8 +809,8 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@ -149,7 +148,7 @@
}
}
}
@@ -797,6 +869,29 @@
@@ -802,6 +873,29 @@
} else {
this.o();
chunkgenerator.recreateStructures(this.locX, this.locZ);

Datei anzeigen

@ -1,109 +1,41 @@
--- a/net/minecraft/server/ChunkProviderServer.java
+++ b/net/minecraft/server/ChunkProviderServer.java
@@ -1,24 +1,31 @@
package net.minecraft.server;
-import com.google.common.collect.Lists;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
+
@@ -14,10 +14,17 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+
+import org.bukkit.Server;
+import org.bukkit.craftbukkit.chunkio.ChunkIOExecutor;
+import org.bukkit.craftbukkit.util.LongHash;
+import org.bukkit.craftbukkit.util.LongHashSet;
+import org.bukkit.craftbukkit.util.LongObjectHashMap;
+import org.bukkit.event.world.ChunkUnloadEvent;
+// CraftBukkit end
+
public class ChunkProviderServer implements IChunkProvider {
private static final Logger a = LogManager.getLogger();
- private final Set<Long> unloadQueue = Collections.newSetFromMap(new ConcurrentHashMap());
- private final ChunkGenerator chunkGenerator;
- private final Set<Long> unloadQueue = Sets.newHashSet();
+ public final LongHashSet unloadQueue = new LongHashSet(); // CraftBukkit - LongHashSet
+ public final ChunkGenerator chunkGenerator; // CraftBukkit - public
public final ChunkGenerator chunkGenerator;
private final IChunkLoader chunkLoader;
- private final LongHashMap<Chunk> chunks = new LongHashMap();
- private final List<Chunk> chunkList = Lists.newArrayList();
+ public LongObjectHashMap<Chunk> chunks = new LongObjectHashMap<Chunk>(); // CraftBukkit
+ // private final LongHashMap<Chunk> chunks = new LongHashMap();
+ // private final List<Chunk> chunkList = Lists.newArrayList();
public final WorldServer world;
public final Long2ObjectMap<Chunk> chunks = new Long2ObjectOpenHashMap(8192);
@@ -35,7 +42,14 @@
public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, ChunkGenerator chunkgenerator) {
@@ -27,19 +34,33 @@
this.chunkGenerator = chunkgenerator;
}
- public List<Chunk> a() {
- return this.chunkList;
+ public boolean isChunkLoaded(int i, int j) {
+ return this.chunks.containsKey(LongHash.toLong(i, j)); // CraftBukkit
+ }
+
+ // CraftBukkit start - Change return type to Collection and return the values of our chunk map
+ public java.util.Collection a() {
+ // return this.chunkList;
+ return this.chunks.values();
+ // CraftBukkit end
}
public void queueUnload(int i, int j) {
if (this.world.worldProvider.c(i, j)) {
- this.unloadQueue.add(Long.valueOf(ChunkCoordIntPair.a(i, j)));
public void unload(Chunk chunk) {
if (this.world.worldProvider.c(chunk.locX, chunk.locZ)) {
- this.unloadQueue.add(Long.valueOf(ChunkCoordIntPair.a(chunk.locX, chunk.locZ)));
+ // CraftBukkit start
+ this.unloadQueue.add(i, j);
+ this.unloadQueue.add(chunk.locX, chunk.locZ);
+
+ Chunk c = chunks.get(LongHash.toLong(i, j));
+ Chunk c = chunks.get(ChunkCoordIntPair.a(chunk.locX, chunk.locZ));
+ if (c != null) {
+ c.mustSave = true;
+ }
+ // CraftBukkit end
chunk.d = true;
}
}
public void b() {
- Iterator iterator = this.chunkList.iterator();
+ Iterator iterator = this.chunks.values().iterator(); // CraftBukkit
while (iterator.hasNext()) {
Chunk chunk = (Chunk) iterator.next();
@@ -49,11 +70,20 @@
}
+ // CraftBukkit start - Add async variant, provide compatibility
+ public Chunk getOrCreateChunkFast(int x, int z) {
+ Chunk chunk = chunks.get(LongHash.toLong(x, z));
+ return (chunk == null) ? getChunkAt(x, z) : chunk;
+ }
+
+ public Chunk getChunkIfLoaded(int x, int z) {
+ return chunks.get(LongHash.toLong(x, z));
+ }
+
public Chunk getLoadedChunkAt(int i, int j) {
- long k = ChunkCoordIntPair.a(i, j);
- Chunk chunk = (Chunk) this.chunks.getEntry(k);
+ Chunk chunk = chunks.get(LongHash.toLong(i, j)); // CraftBukkit
- this.unloadQueue.remove(Long.valueOf(k));
+ this.unloadQueue.remove(i, j); // CraftBukkit
return chunk;
}
@@ -61,20 +91,71 @@
@@ -69,19 +83,68 @@
Chunk chunk = this.getLoadedChunkAt(i, j);
if (chunk == null) {
@ -120,7 +52,6 @@
+ /* chunk = this.loadChunk(i, j);
if (chunk != null) {
this.chunks.put(ChunkCoordIntPair.a(i, j), chunk);
this.chunkList.add(chunk);
chunk.addEntities();
chunk.loadNearby(this, this.chunkGenerator);
}
@ -132,7 +63,6 @@
}
public Chunk getChunkAt(int i, int j) {
- Chunk chunk = this.getOrLoadChunkAt(i, j);
+ return getChunkAt(i, j, null);
+ }
+
@ -141,8 +71,7 @@
+ }
+
+ public Chunk getChunkAt(int i, int j, Runnable runnable, boolean generate) {
+ unloadQueue.remove(i, j);
+ Chunk chunk = chunks.get(LongHash.toLong(i, j));
+ Chunk chunk = chunks.get(ChunkCoordIntPair.a(i, j));
+ ChunkRegionLoader loader = null;
+
+ if (this.chunkLoader instanceof ChunkRegionLoader) {
@ -170,23 +99,19 @@
+ }
+
+ public Chunk originalGetChunkAt(int i, int j) {
+ this.unloadQueue.remove(i, j);
+ Chunk chunk = this.chunks.get(LongHash.toLong(i, j));
Chunk chunk = this.getOrLoadChunkAt(i, j);
+ boolean newChunk = false;
+ // CraftBukkit end
if (chunk == null) {
long k = ChunkCoordIntPair.a(i, j);
@@ -92,11 +173,38 @@
crashreportsystemdetails.a("Generator", (Object) this.chunkGenerator);
throw new ReportedException(crashreport);
}
+ newChunk = true; // CraftBukkit
@@ -97,9 +160,37 @@
crashreportsystemdetails.a("Generator", (Object) this.chunkGenerator);
throw new ReportedException(crashreport);
}
+ newChunk = true; // CraftBukkit
- this.chunks.put(k, chunk);
- this.chunkList.add(chunk);
+ this.chunks.put(LongHash.toLong(i, j), chunk); // CraftBukkit
this.chunks.put(k, chunk);
chunk.addEntities();
+
+ // CraftBukkit start
@ -207,7 +132,7 @@
+ continue;
+ }
+
+ Chunk neighbor = this.getChunkIfLoaded(chunk.locX + x, chunk.locZ + z);
+ Chunk neighbor = this.getLoadedChunkAt(chunk.locX + x, chunk.locZ + z);
+ if (neighbor != null) {
+ neighbor.setNeighborLoaded(-x, -z);
+ chunk.setNeighborLoaded(x, z);
@ -218,11 +143,11 @@
chunk.loadNearby(this, this.chunkGenerator);
}
@@ -142,10 +250,12 @@
@@ -146,10 +237,12 @@
public boolean a(boolean flag) {
int i = 0;
- ArrayList arraylist = Lists.newArrayList(this.chunkList);
- ArrayList arraylist = Lists.newArrayList(this.chunks.values());
- for (int j = 0; j < arraylist.size(); ++j) {
- Chunk chunk = (Chunk) arraylist.get(j);
@ -234,14 +159,16 @@
if (flag) {
this.saveChunkNOP(chunk);
@@ -170,22 +280,43 @@
@@ -174,22 +267,41 @@
public boolean unloadChunks() {
if (!this.world.savingDisabled) {
- for (int i = 0; i < 100; ++i) {
- if (!this.unloadQueue.isEmpty()) {
- Long olong = (Long) this.unloadQueue.iterator().next();
- Chunk chunk = (Chunk) this.chunks.getEntry(olong.longValue());
- if (!this.unloadQueue.isEmpty()) {
- Iterator iterator = this.unloadQueue.iterator();
-
- for (int i = 0; i < 100 && iterator.hasNext(); iterator.remove()) {
- Long olong = (Long) iterator.next();
- Chunk chunk = (Chunk) this.chunks.get(olong);
+ // CraftBukkit start
+ Server server = this.world.getServer();
+ for (int i = 0; i < 100 && !this.unloadQueue.isEmpty(); ++i) {
@ -253,17 +180,15 @@
+ server.getPluginManager().callEvent(event);
+ if (!event.isCancelled()) {
if (chunk != null) {
- if (chunk != null && chunk.d) {
+ if (chunk != null) {
chunk.removeEntities();
this.saveChunk(chunk);
this.saveChunkNOP(chunk);
- this.chunks.remove(olong.longValue());
- this.chunkList.remove(chunk);
- this.chunks.remove(olong);
- ++i;
+ this.chunks.remove(chunkcoordinates); // CraftBukkit
}
- this.unloadQueue.remove(olong);
+ // this.unloadQueue.remove(olong);
+ }
+
+ // Update neighbor counts
+ for (int x = -2; x < 3; x++) {
@ -272,40 +197,16 @@
+ continue;
+ }
+
+ Chunk neighbor = this.getChunkIfLoaded(chunk.locX + x, chunk.locZ + z);
+ Chunk neighbor = this.getLoadedChunkAt(chunk.locX + x, chunk.locZ + z);
+ if (neighbor != null) {
+ neighbor.setNeighborUnloaded(-x, -z);
+ chunk.setNeighborUnloaded(x, z);
+ }
+ }
+ }
}
}
}
+ // CraftBukkit end
this.chunkLoader.a();
}
@@ -198,7 +329,8 @@
}
public String getName() {
- return "ServerChunkCache: " + this.chunks.count() + " Drop: " + this.unloadQueue.size();
+ // CraftBukkit - this.chunks.count() -> .size()
+ return "ServerChunkCache: " + this.chunks.size() + " Drop: " + this.unloadQueue.size();
}
public List<BiomeBase.BiomeMeta> a(EnumCreatureType enumcreaturetype, BlockPosition blockposition) {
@@ -210,10 +342,11 @@
}
public int g() {
- return this.chunks.count();
+ // CraftBukkit - this.chunks.count() -> this.chunks.size()
+ return this.chunks.size();
}
public boolean e(int i, int j) {
- return this.chunks.contains(ChunkCoordIntPair.a(i, j));
+ return this.chunks.containsKey(LongHash.toLong(i, j)); // CraftBukkit
}
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkRegionLoader.java
+++ b/net/minecraft/server/ChunkRegionLoader.java
@@ -28,7 +28,35 @@
@@ -29,8 +29,36 @@
this.e = dataconvertermanager;
}
@ -19,6 +19,7 @@
+ // CraftBukkit end
+
+ // CraftBukkit start - Add async variant, provide compatibility
@Nullable
public Chunk a(World world, int i, int j) throws IOException {
+ Object[] data = loadChunk(world, i, j);
+ if (data != null) {
@ -36,7 +37,7 @@
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(chunkcoordintpair);
@@ -45,7 +73,7 @@
@@ -47,7 +75,7 @@
return this.a(world, i, j, nbttagcompound);
}
@ -45,7 +46,7 @@
if (!nbttagcompound.hasKeyOfType("Level", 10)) {
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is missing level data, skipping");
return null;
@@ -62,10 +90,28 @@
@@ -64,10 +92,28 @@
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.locX + ", " + chunk.locZ + ")");
nbttagcompound1.setInt("xPos", i);
nbttagcompound1.setInt("zPos", j);
@ -75,7 +76,7 @@
}
}
}
@@ -295,6 +341,13 @@
@@ -296,6 +342,13 @@
chunk.a(nbttagcompound.getByteArray("Biomes"));
}
@ -89,7 +90,7 @@
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
if (nbttaglist1 != null) {
@@ -338,7 +391,7 @@
@@ -339,7 +392,7 @@
}
}
@ -97,8 +98,8 @@
+ // return chunk; // CraftBukkit
}
public static Entity a(NBTTagCompound nbttagcompound, World world, Chunk chunk) {
@@ -399,8 +452,14 @@
@Nullable
@@ -403,8 +456,14 @@
}
}
@ -111,6 +112,6 @@
+ public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
+ if (world.addEntity(entity, reason) && entity.isVehicle()) {
+ // CraftBukkit end
Iterator iterator = entity.bu().iterator();
Iterator iterator = entity.bv().iterator();
while (iterator.hasNext()) {

Datei anzeigen

@ -2,7 +2,7 @@
+++ b/net/minecraft/server/CommandBlockListenerAbstract.java
@@ -4,6 +4,13 @@
import java.util.Date;
import java.util.concurrent.Callable;
import javax.annotation.Nullable;
+// CraftBukkit start
+import java.util.ArrayList;
@ -22,7 +22,7 @@
public CommandBlockListenerAbstract() {}
@@ -91,7 +99,9 @@
@@ -92,7 +100,9 @@
try {
this.d = null;
@ -33,7 +33,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Executing command block");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed");
@@ -123,6 +133,125 @@
@@ -124,6 +134,125 @@
}
}

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/CommandExecute.java
+++ b/net/minecraft/server/CommandExecute.java
@@ -3,6 +3,10 @@
import java.util.Collection;
@@ -4,6 +4,10 @@
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.command.ProxiedNativeCommandSender;
+import org.bukkit.craftbukkit.command.VanillaCommandWrapper;
@ -11,7 +11,7 @@
public class CommandExecute extends CommandAbstract {
@@ -49,7 +53,10 @@
@@ -50,7 +54,10 @@
}
String s = a(astring, b0);
@ -23,7 +23,7 @@
public String getName() {
return entity.getName();
}
@@ -94,25 +101,57 @@
@@ -95,25 +102,57 @@
return entity.h();
}
};
@ -67,7 +67,7 @@
}
}
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, BlockPosition blockposition) {
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) {
- return astring.length == 1 ? a(astring, minecraftserver.getPlayers()) : (astring.length > 1 && astring.length <= 4 ? a(astring, 1, blockposition) : (astring.length > 5 && astring.length <= 8 && "detect".equals(astring[4]) ? a(astring, 5, blockposition) : (astring.length == 9 && "detect".equals(astring[4]) ? a(astring, (Collection) Block.REGISTRY.keySet()) : Collections.emptyList())));
+ return astring.length == 1 ? a(astring, minecraftserver.getPlayers()) : (astring.length > 1 && astring.length <= 4 ? a(astring, 1, blockposition) : (astring.length > 5 && astring.length <= 8 && "detect".equals(astring[4]) ? a(astring, 5, blockposition) : (astring.length == 9 && "detect".equals(astring[4]) ? a(astring, (Collection) Block.REGISTRY.keySet()) : Collections.<String>emptyList()))); // CraftBukkit - decompile error
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandGamemode.java
+++ b/net/minecraft/server/CommandGamemode.java
@@ -27,6 +27,12 @@
@@ -28,6 +28,12 @@
EntityPlayer entityplayer = astring.length >= 2 ? a(minecraftserver, icommandlistener, astring[1]) : a(icommandlistener);
entityplayer.a(worldsettings_enumgamemode);
@ -13,10 +13,10 @@
ChatMessage chatmessage = new ChatMessage("gameMode." + worldsettings_enumgamemode.b(), new Object[0]);
if (icommandlistener.getWorld().getGameRules().getBoolean("sendCommandFeedback")) {
@@ -49,10 +55,17 @@
@@ -50,10 +56,17 @@
}
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, BlockPosition blockposition) {
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) {
- return astring.length == 1 ? a(astring, new String[] { "survival", "creative", "adventure", "spectator"}) : (astring.length == 2 ? a(astring, minecraftserver.getPlayers()) : Collections.emptyList());
+ return astring.length == 1 ? a(astring, new String[] { "survival", "creative", "adventure", "spectator"}) : (astring.length == 2 ? a(astring, minecraftserver.getPlayers()) : Collections.<String>emptyList()); // CraftBukkit - decompile error
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandGamerule.java
+++ b/net/minecraft/server/CommandGamerule.java
@@ -21,7 +21,7 @@
@@ -22,7 +22,7 @@
}
public void execute(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring) throws CommandException {
@ -9,7 +9,7 @@
String s = astring.length > 0 ? astring[0] : "";
String s1 = astring.length > 1 ? a(astring, 1) : "";
@@ -86,4 +86,11 @@
@@ -87,4 +87,11 @@
private GameRules a(MinecraftServer minecraftserver) {
return minecraftserver.getWorldServer(0).getGameRules();
}

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java
@@ -235,9 +235,16 @@
@@ -236,9 +236,16 @@
}
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, BlockPosition blockposition) {
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) {
- return astring.length >= 1 && astring.length <= 2 ? b(astring, 0, blockposition) : Collections.emptyList();
+ return astring.length >= 1 && astring.length <= 2 ? b(astring, 0, blockposition) : Collections.<String>emptyList(); // CraftBukkit - decompile error
}
@ -18,7 +18,7 @@
static class Location2D {
double a;
@@ -304,7 +311,7 @@
@@ -305,7 +312,7 @@
}
blockposition = blockposition.down();
@ -27,7 +27,7 @@
return blockposition.getY() + 1;
}
@@ -320,7 +327,7 @@
@@ -321,7 +328,7 @@
}
blockposition = blockposition.down();
@ -36,7 +36,7 @@
} while (material == Material.AIR);
return !material.isLiquid() && material != Material.FIRE;
@@ -330,5 +337,12 @@
@@ -331,5 +338,12 @@
this.a = MathHelper.a(random, d0, d2);
this.b = MathHelper.a(random, d1, d3);
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandTp.java
+++ b/net/minecraft/server/CommandTp.java
@@ -97,27 +97,28 @@
@@ -98,27 +98,28 @@
} else {
Entity entity = b(minecraftserver, icommandlistener, astring[astring.length - 1]);
@ -24,7 +24,7 @@
}
}
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, BlockPosition blockposition) {
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) {
- return astring.length != 1 && astring.length != 2 ? Collections.emptyList() : a(astring, minecraftserver.getPlayers());
+ return astring.length != 1 && astring.length != 2 ? Collections.<String>emptyList() : a(astring, minecraftserver.getPlayers()); // CraftBukkit - decompile error
}

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/Container.java
+++ b/net/minecraft/server/Container.java
@@ -7,6 +7,17 @@
import java.util.List;
@@ -8,6 +8,17 @@
import java.util.Set;
import javax.annotation.Nullable;
+// CraftBukkit start
+import java.util.HashMap;
@ -18,7 +18,7 @@
public abstract class Container {
public List<ItemStack> b = Lists.newArrayList();
@@ -18,12 +29,24 @@
@@ -19,12 +30,24 @@
protected List<ICrafting> listeners = Lists.newArrayList();
private Set<EntityHuman> i = Sets.newHashSet();
@ -44,7 +44,7 @@
return slot;
}
@@ -124,6 +147,7 @@
@@ -128,6 +151,7 @@
k = playerinventory.getCarried().count;
Iterator iterator = this.h.iterator();
@ -52,7 +52,7 @@
while (iterator.hasNext()) {
Slot slot1 = (Slot) iterator.next();
@@ -141,16 +165,48 @@
@@ -145,16 +169,48 @@
}
k -= itemstack2.count - i1;
@ -106,7 +106,7 @@
}
this.d();
@@ -173,8 +229,14 @@
@@ -177,8 +233,14 @@
}
if (j == 1) {
@ -123,7 +123,7 @@
playerinventory.setCarried((ItemStack) null);
}
}
@@ -225,7 +287,11 @@
@@ -229,7 +291,11 @@
slot2.set(itemstack3.cloneAndSubtract(j1));
if (itemstack3.count == 0) {
playerinventory.setCarried((ItemStack) null);
@ -135,7 +135,7 @@
}
} else if (slot2.isAllowed(entityhuman)) {
if (itemstack3 == null) {
@@ -255,7 +321,11 @@
@@ -259,7 +325,11 @@
itemstack3.cloneAndSubtract(j1);
if (itemstack3.count == 0) {
playerinventory.setCarried((ItemStack) null);
@ -147,7 +147,7 @@
itemstack1.count += j1;
} else if (itemstack3.count <= slot2.getMaxStackSize(itemstack3)) {
@@ -264,7 +334,10 @@
@@ -268,7 +338,10 @@
}
} else if (itemstack1.getItem() == itemstack3.getItem() && itemstack3.getMaxStackSize() > 1 && (!itemstack1.usesData() || itemstack1.getData() == itemstack3.getData()) && ItemStack.equals(itemstack1, itemstack3)) {
j1 = itemstack1.count;
@ -159,7 +159,7 @@
itemstack3.count += j1;
itemstack1 = slot2.a(j1);
if (itemstack1.count == 0) {
@@ -272,11 +345,24 @@
@@ -276,11 +349,24 @@
}
slot2.a(entityhuman, playerinventory.getCarried());
@ -184,7 +184,7 @@
}
}
} else if (inventoryclicktype == InventoryClickType.SWAP && j >= 0 && j < 9) {
@@ -430,14 +516,17 @@
@@ -434,14 +520,17 @@
if (itemstack1 != null && a(itemstack, itemstack1)) {
int l = itemstack1.count + itemstack.count;

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ContainerAnvil.java
+++ b/net/minecraft/server/ContainerAnvil.java
@@ -6,6 +6,12 @@
@@ -7,6 +7,12 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -13,7 +13,7 @@
public class ContainerAnvil extends Container {
private static final Logger f = LogManager.getLogger();
@@ -22,8 +28,13 @@
@@ -23,8 +29,13 @@
private int k;
private String l;
private final EntityHuman m;
@ -27,7 +27,7 @@
this.j = blockposition;
this.i = world;
this.m = entityhuman;
@@ -109,7 +120,7 @@
@@ -110,7 +121,7 @@
byte b1 = 0;
if (itemstack == null) {
@ -36,7 +36,7 @@
this.a = 0;
} else {
ItemStack itemstack1 = itemstack.cloneItemStack();
@@ -127,7 +138,7 @@
@@ -128,7 +139,7 @@
if (itemstack1.e() && itemstack1.getItem().a(itemstack, itemstack2)) {
k = Math.min(itemstack1.h(), itemstack1.j() / 4);
if (k <= 0) {
@ -45,7 +45,7 @@
this.a = 0;
return;
}
@@ -142,7 +153,7 @@
@@ -143,7 +154,7 @@
this.k = l;
} else {
if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.e())) {
@ -54,7 +54,7 @@
this.a = 0;
return;
}
@@ -269,7 +280,7 @@
@@ -270,7 +281,7 @@
EnchantmentManager.a(map, itemstack1);
}
@ -63,7 +63,7 @@
this.b();
}
}
@@ -294,6 +305,7 @@
@@ -295,6 +306,7 @@
}
public boolean a(EntityHuman entityhuman) {
@ -71,7 +71,7 @@
return this.i.getType(this.j).getBlock() != Blocks.ANVIL ? false : entityhuman.e((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D;
}
@@ -350,6 +362,20 @@
@@ -352,6 +364,20 @@
this.e();
}

Datei anzeigen

@ -1,10 +1,11 @@
--- a/net/minecraft/server/ContainerBeacon.java
+++ b/net/minecraft/server/ContainerBeacon.java
@@ -1,11 +1,18 @@
@@ -1,13 +1,19 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
+
public class ContainerBeacon extends Container {
private IInventory beacon;
@ -19,7 +20,7 @@
this.beacon = iinventory1;
this.a((Slot) (this.f = new ContainerBeacon.SlotBeacon(iinventory1, 0, 136, 110)));
byte b0 = 36;
@@ -47,6 +54,7 @@
@@ -49,6 +55,7 @@
}
public boolean a(EntityHuman entityhuman) {
@ -27,7 +28,7 @@
return this.beacon.a(entityhuman);
}
@@ -110,4 +118,17 @@
@@ -113,4 +120,17 @@
return 1;
}
}

Datei anzeigen

@ -1,17 +1,17 @@
--- a/net/minecraft/server/ContainerBrewingStand.java
+++ b/net/minecraft/server/ContainerBrewingStand.java
@@ -1,5 +1,10 @@
@@ -1,6 +1,10 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
+
public class ContainerBrewingStand extends Container {
private IInventory brewingStand;
@@ -7,7 +12,13 @@
@@ -9,7 +13,13 @@
private int g;
private int h;
@ -25,7 +25,7 @@
this.brewingStand = iinventory;
this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(playerinventory.player, iinventory, 0, 56, 51)));
this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(playerinventory.player, iinventory, 1, 79, 58)));
@@ -54,6 +65,7 @@
@@ -56,6 +66,7 @@
}
public boolean a(EntityHuman entityhuman) {
@ -33,7 +33,7 @@
return this.brewingStand.a(entityhuman);
}
@@ -182,4 +194,17 @@
@@ -185,4 +196,17 @@
}
}
}

Datei anzeigen

@ -1,13 +1,14 @@
--- a/net/minecraft/server/ContainerChest.java
+++ b/net/minecraft/server/ContainerChest.java
@@ -1,9 +1,37 @@
@@ -1,11 +1,38 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventory;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
+
public class ContainerChest extends Container {
private IInventory container;
@ -38,7 +39,7 @@
public ContainerChest(IInventory iinventory, IInventory iinventory1, EntityHuman entityhuman) {
this.container = iinventory1;
@@ -11,6 +39,11 @@
@@ -13,6 +40,11 @@
iinventory1.startOpen(entityhuman);
int i = (this.f - 4) * 18;
@ -50,7 +51,7 @@
int j;
int k;
@@ -33,6 +66,7 @@
@@ -35,6 +67,7 @@
}
public boolean a(EntityHuman entityhuman) {

Datei anzeigen

@ -1,13 +1,14 @@
--- a/net/minecraft/server/ContainerDispenser.java
+++ b/net/minecraft/server/ContainerDispenser.java
@@ -1,11 +1,24 @@
@@ -1,13 +1,25 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventory;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
+
public class ContainerDispenser extends Container {
public IInventory items;
@ -25,7 +26,7 @@
int i;
int j;
@@ -29,6 +42,7 @@
@@ -31,6 +43,7 @@
}
public boolean a(EntityHuman entityhuman) {
@ -33,7 +34,7 @@
return this.items.a(entityhuman);
}
@@ -63,4 +77,17 @@
@@ -66,4 +79,17 @@
return itemstack;
}

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/ContainerEnchantTable.java
+++ b/net/minecraft/server/ContainerEnchantTable.java
@@ -3,9 +3,22 @@
import java.util.List;
@@ -4,9 +4,22 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import java.util.Map;
@ -24,7 +24,7 @@
public int getMaxStackSize() {
return 64;
}
@@ -14,6 +27,11 @@
@@ -15,6 +28,11 @@
super.update();
ContainerEnchantTable.this.a((IInventory) this);
}
@ -36,7 +36,7 @@
};
private World world;
private BlockPosition position;
@@ -22,6 +40,10 @@
@@ -23,6 +41,10 @@
public int[] costs = new int[3];
public int[] h = new int[] { -1, -1, -1};
public int[] i = new int[] { -1, -1, -1};
@ -47,7 +47,7 @@
public ContainerEnchantTable(PlayerInventory playerinventory, World world, BlockPosition blockposition) {
this.world = world;
@@ -54,6 +76,9 @@
@@ -55,6 +77,9 @@
this.a(new Slot(playerinventory, i, 8 + i * 18, 142));
}
@ -57,7 +57,7 @@
}
protected void c(ICrafting icrafting) {
@@ -90,7 +115,7 @@
@@ -91,7 +116,7 @@
ItemStack itemstack = iinventory.getItem(0);
int i;
@ -66,7 +66,7 @@
if (!this.world.isClientSide) {
i = 0;
@@ -139,6 +164,20 @@
@@ -140,6 +165,20 @@
}
}
@ -87,7 +87,7 @@
for (j = 0; j < 3; ++j) {
if (this.costs[j] > 0) {
List list = this.a(itemstack, j, this.costs[j]);
@@ -175,24 +214,55 @@
@@ -176,24 +215,55 @@
} else if (this.costs[i] > 0 && itemstack != null && (entityhuman.expLevel >= j && entityhuman.expLevel >= this.costs[i] || entityhuman.abilities.canInstantlyBuild)) {
if (!this.world.isClientSide) {
List list = this.a(itemstack, i, this.costs[i]);
@ -150,7 +150,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1.count -= j;
if (itemstack1.count <= 0) {
@@ -226,6 +296,11 @@
@@ -227,6 +297,11 @@
public void b(EntityHuman entityhuman) {
super.b(entityhuman);
@ -162,7 +162,7 @@
if (!this.world.isClientSide) {
for (int i = 0; i < this.enchantSlots.getSize(); ++i) {
ItemStack itemstack = this.enchantSlots.splitWithoutUpdate(i);
@@ -239,6 +314,7 @@
@@ -240,6 +315,7 @@
}
public boolean a(EntityHuman entityhuman) {
@ -170,7 +170,7 @@
return this.world.getType(this.position).getBlock() != Blocks.ENCHANTING_TABLE ? false : entityhuman.e((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D;
}
@@ -291,4 +367,17 @@
@@ -293,4 +369,17 @@
return itemstack;
}

Datei anzeigen

@ -1,17 +1,17 @@
--- a/net/minecraft/server/ContainerFurnace.java
+++ b/net/minecraft/server/ContainerFurnace.java
@@ -1,5 +1,10 @@
@@ -1,6 +1,10 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
+
public class ContainerFurnace extends Container {
private final IInventory furnace;
@@ -8,11 +13,28 @@
@@ -10,11 +14,28 @@
private int h;
private int i;
@ -40,7 +40,7 @@
int i;
@@ -63,6 +85,7 @@
@@ -65,6 +86,7 @@
}
public boolean a(EntityHuman entityhuman) {

Datei anzeigen

@ -1,13 +1,14 @@
--- a/net/minecraft/server/ContainerHopper.java
+++ b/net/minecraft/server/ContainerHopper.java
@@ -1,11 +1,33 @@
@@ -1,13 +1,34 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventory;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
+
public class ContainerHopper extends Container {
private final IInventory hopper;
@ -34,7 +35,7 @@
iinventory.startOpen(entityhuman);
byte b0 = 51;
@@ -28,6 +50,7 @@
@@ -30,6 +51,7 @@
}
public boolean a(EntityHuman entityhuman) {

Datei anzeigen

@ -1,14 +1,15 @@
--- a/net/minecraft/server/ContainerHorse.java
+++ b/net/minecraft/server/ContainerHorse.java
@@ -1,11 +1,33 @@
@@ -1,13 +1,34 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventory;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+import org.bukkit.inventory.InventoryView;
+// CraftBukkit end
+
public class ContainerHorse extends Container {
private IInventory a;

Datei anzeigen

@ -1,13 +1,14 @@
--- a/net/minecraft/server/ContainerMerchant.java
+++ b/net/minecraft/server/ContainerMerchant.java
@@ -1,11 +1,26 @@
@@ -1,6 +1,7 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
+
public class ContainerMerchant extends Container {
private IMerchant merchant;
@@ -8,6 +9,19 @@
private InventoryMerchant f;
private final World g;
@ -27,7 +28,7 @@
public ContainerMerchant(PlayerInventory playerinventory, IMerchant imerchant, World world) {
this.merchant = imerchant;
this.g = world;
@@ -13,6 +28,7 @@
@@ -15,6 +29,7 @@
this.a(new Slot(this.f, 0, 36, 53));
this.a(new Slot(this.f, 1, 62, 53));
this.a((Slot) (new SlotMerchantResult(playerinventory.player, imerchant, this.f, 2, 120, 53)));

Datei anzeigen

@ -1,17 +1,17 @@
--- a/net/minecraft/server/ContainerPlayer.java
+++ b/net/minecraft/server/ContainerPlayer.java
@@ -1,5 +1,10 @@
@@ -1,6 +1,10 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
+
public class ContainerPlayer extends Container {
private static final EnumItemSlot[] h = new EnumItemSlot[] { EnumItemSlot.HEAD, EnumItemSlot.CHEST, EnumItemSlot.LEGS, EnumItemSlot.FEET};
@@ -7,10 +12,20 @@
@@ -9,10 +13,20 @@
public IInventory resultInventory = new InventoryCraftResult();
public boolean g;
private final EntityHuman owner;
@ -32,7 +32,7 @@
this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 154, 28)));
int i;
@@ -23,7 +38,7 @@
@@ -25,7 +39,7 @@
}
for (i = 0; i < 4; ++i) {
@ -41,7 +41,7 @@
this.a(new Slot(playerinventory, 36 + (3 - i), 8, 8 + i * 18) {
public int getMaxStackSize() {
@@ -57,11 +72,22 @@
@@ -59,11 +73,22 @@
return super.isAllowed(itemstack);
}
});
@ -66,7 +66,7 @@
}
public void b(EntityHuman entityhuman) {
@@ -143,4 +169,17 @@
@@ -146,4 +171,17 @@
public boolean a(ItemStack itemstack, Slot slot) {
return slot.inventory != this.resultInventory && super.a(itemstack, slot);
}

Datei anzeigen

@ -1,13 +1,14 @@
--- a/net/minecraft/server/ContainerWorkbench.java
+++ b/net/minecraft/server/ContainerWorkbench.java
@@ -1,13 +1,28 @@
@@ -1,15 +1,29 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
+
public class ContainerWorkbench extends Container {
- public InventoryCrafting craftInventory = new InventoryCrafting(this, 3, 3);
@ -31,7 +32,7 @@
this.g = world;
this.h = blockposition;
this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 124, 35)));
@@ -35,7 +50,21 @@
@@ -37,7 +51,21 @@
}
public void a(IInventory iinventory) {
@ -54,7 +55,7 @@
}
public void b(EntityHuman entityhuman) {
@@ -53,6 +82,7 @@
@@ -55,6 +83,7 @@
}
public boolean a(EntityHuman entityhuman) {
@ -62,7 +63,7 @@
return this.g.getType(this.h).getBlock() != Blocks.CRAFTING_TABLE ? false : entityhuman.e((double) this.h.getX() + 0.5D, (double) this.h.getY() + 0.5D, (double) this.h.getZ() + 0.5D) <= 64.0D;
}
@@ -101,4 +131,17 @@
@@ -104,4 +133,17 @@
public boolean a(ItemStack itemstack, Slot slot) {
return slot.inventory != this.resultInventory && super.a(itemstack, slot);
}

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/CraftingManager.java
+++ b/net/minecraft/server/CraftingManager.java
@@ -9,10 +9,16 @@
import java.util.Iterator;
@@ -10,10 +10,16 @@
import java.util.List;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
@ -17,7 +17,7 @@
public static CraftingManager getInstance() {
return CraftingManager.a;
@@ -176,7 +182,12 @@
@@ -177,7 +183,12 @@
this.registerShapedRecipe(new ItemStack(Blocks.HOPPER), new Object[] { "I I", "ICI", " I ", Character.valueOf('I'), Items.IRON_INGOT, Character.valueOf('C'), Blocks.CHEST});
this.registerShapedRecipe(new ItemStack(Items.ARMOR_STAND, 1), new Object[] { "///", " / ", "/_/", Character.valueOf('/'), Items.STICK, Character.valueOf('_'), new ItemStack(Blocks.STONE_SLAB, 1, BlockDoubleStepAbstract.EnumStoneSlabVariant.STONE.a())});
this.registerShapedRecipe(new ItemStack(Blocks.END_ROD, 4), new Object[] { "/", "#", Character.valueOf('/'), Items.BLAZE_ROD, Character.valueOf('#'), Items.CHORUS_FRUIT_POPPED});
@ -31,7 +31,7 @@
public int a(IRecipe irecipe, IRecipe irecipe1) {
return irecipe instanceof ShapelessRecipes && irecipe1 instanceof ShapedRecipes ? 1 : (irecipe1 instanceof ShapelessRecipes && irecipe instanceof ShapedRecipes ? -1 : (irecipe1.a() < irecipe.a() ? -1 : (irecipe1.a() > irecipe.a() ? 1 : 0)));
}
@@ -283,13 +294,18 @@
@@ -285,13 +296,18 @@
do {
if (!iterator.hasNext()) {

Datei anzeigen

@ -1,10 +1,10 @@
--- a/net/minecraft/server/CrashReport.java
+++ b/net/minecraft/server/CrashReport.java
@@ -124,6 +124,7 @@
@@ -123,6 +123,7 @@
return this.a();
}
});
+ this.d.a("CraftBukkit Information", (Callable) (new org.bukkit.craftbukkit.CraftCrashReport())); // CraftBukkit
+ this.d.a("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit
}
public String a() {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/DataPaletteBlock.java
+++ b/net/minecraft/server/DataPaletteBlock.java
@@ -109,7 +109,21 @@
@@ -112,7 +112,21 @@
int i1 = nibblearray1 == null ? 0 : nibblearray1.a(j, k, l);
int j1 = i1 << 12 | (abyte[i] & 255) << 4 | nibblearray.a(j, k, l);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/DataWatcher.java
+++ b/net/minecraft/server/DataWatcher.java
@@ -54,7 +54,7 @@
@@ -55,7 +55,7 @@
}
}
@ -9,7 +9,7 @@
int i = datawatcherobject.a();
if (i > 254) {
@@ -68,7 +68,7 @@
@@ -69,7 +69,7 @@
}
}

Datei anzeigen

@ -12,7 +12,7 @@
import java.net.InetAddress;
import java.net.Proxy;
import java.util.Collections;
@@ -18,10 +17,20 @@
@@ -17,10 +16,20 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -34,7 +34,7 @@
private RemoteStatusListener m;
public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this);
private RemoteControlListener o;
@@ -31,8 +40,10 @@
@@ -30,8 +39,10 @@
private WorldSettings.EnumGamemode s;
private boolean t;
@ -47,7 +47,7 @@
Thread thread = new Thread("Server Infinisleeper") {
{
this.setDaemon(true);
@@ -54,13 +65,27 @@
@@ -53,13 +64,27 @@
protected boolean init() throws IOException {
Thread thread = new Thread("Server console handler") {
public void run() {
@ -78,7 +78,7 @@
}
} catch (IOException ioexception) {
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
@@ -69,6 +94,27 @@
@@ -68,6 +93,27 @@
}
};
@ -105,8 +105,8 @@
+
thread.setDaemon(true);
thread.start();
DedicatedServer.LOGGER.info("Starting minecraft server version 1.9.2");
@@ -77,7 +123,7 @@
DedicatedServer.LOGGER.info("Starting minecraft server version 1.9.4");
@@ -76,7 +122,7 @@
}
DedicatedServer.LOGGER.info("Loading properties");
@ -115,7 +115,7 @@
this.q = new EULA(new File("eula.txt"));
if (!this.q.a()) {
DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info.");
@@ -133,6 +179,8 @@
@@ -132,6 +178,8 @@
return false;
}
@ -124,7 +124,7 @@
if (!this.getOnlineMode()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
@@ -147,7 +195,7 @@
@@ -146,7 +194,7 @@
if (!NameReferencingFileConverter.a(this.propertyManager)) {
return false;
} else {
@ -133,7 +133,7 @@
long j = System.nanoTime();
if (this.S() == null) {
@@ -205,7 +253,18 @@
@@ -204,7 +252,18 @@
DedicatedServer.LOGGER.info("Starting remote control listener");
this.o = new RemoteControlListener(this);
this.o.a();
@ -152,7 +152,7 @@
if (this.aP() > 0L) {
Thread thread1 = new Thread(new ThreadWatchdog(this));
@@ -298,7 +357,7 @@
@@ -297,7 +356,7 @@
System.exit(0);
}
@ -161,7 +161,7 @@
super.D();
this.aL();
}
@@ -329,7 +388,15 @@
@@ -328,7 +387,15 @@
while (!this.serverCommandQueue.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
@ -178,7 +178,7 @@
}
}
@@ -536,16 +603,70 @@
@@ -535,16 +602,70 @@
}
public String getPlugins() {

Datei anzeigen

@ -396,7 +396,7 @@
+ EntityBoat entityboat = new EntityBoat(world, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ());
+ // CraftBukkit end
entityboat.a(this.c);
entityboat.setType(this.c);
entityboat.yaw = enumdirection.opposite().l();
world.addEntity(entityboat);
- itemstack.cloneAndSubtract(1);

Datei anzeigen

@ -1,64 +1,41 @@
--- a/net/minecraft/server/DragonControllerManager.java
+++ b/net/minecraft/server/DragonControllerManager.java
@@ -2,32 +2,44 @@
@@ -2,6 +2,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftEnderDragon;
+import org.bukkit.entity.EnderDragon;
+import org.bukkit.event.entity.EnderDragonChangePhaseEvent;
+// CraftBukkit end
public class DragonControllerManager {
private static final Logger a = LogManager.getLogger();
- private final EntityEnderDragon b;
- private final IDragonController[] c = new IDragonController[DragonControllerPhase.c()];
- private IDragonController d;
+ private final EntityEnderDragon b; // PAIL: Rename enderDragon
+ private final IDragonController[] c = new IDragonController[DragonControllerPhase.c()]; // PAIL: Rename dragonControllers
+ private IDragonController d; // PAIL: Rename currentDragonController
public DragonControllerManager(EntityEnderDragon entityenderdragon) {
this.b = entityenderdragon;
this.a(DragonControllerPhase.k);
}
- public void a(DragonControllerPhase<?> dragoncontrollerphase) {
- if (this.d == null || dragoncontrollerphase != this.d.i()) {
+ public void a(DragonControllerPhase<?> dragoncontrollerphase) { // PAIL: Rename setControllerPhase
+ if (this.d == null || dragoncontrollerphase != this.d.i()) { // PAIL: Rename getControllerPhase
if (this.d != null) {
- this.d.e();
+ this.d.e(); // PAIL: Rename
@@ -21,6 +25,19 @@
this.currentDragonController.e();
}
- this.d = this.b(dragoncontrollerphase);
+ // CraftBukkit start - Call EnderDragonChangePhaseEvent
+ EnderDragonChangePhaseEvent event = new EnderDragonChangePhaseEvent((CraftEnderDragon) this.b.getBukkitEntity(), this.d == null ? null : CraftEnderDragon.getBukkitPhase(this.d.i()), CraftEnderDragon.getBukkitPhase(dragoncontrollerphase));
+ this.b.world.getServer().getPluginManager().callEvent(event);
+ EnderDragonChangePhaseEvent event = new EnderDragonChangePhaseEvent(
+ (CraftEnderDragon) this.enderDragon.getBukkitEntity(),
+ (this.currentDragonController == null) ? null : CraftEnderDragon.getBukkitPhase(this.currentDragonController.getControllerPhase()),
+ CraftEnderDragon.getBukkitPhase(dragoncontrollerphase)
+ );
+ this.enderDragon.world.getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return;
+ }
+ dragoncontrollerphase = CraftEnderDragon.getMinecraftPhase(event.getNewPhase());
+ // CraftBukkit end
+
+ this.d = this.b(dragoncontrollerphase); // PAIL: Rename getDragonController
if (!this.b.world.isClientSide) {
- this.b.getDataWatcher().set(EntityEnderDragon.a, Integer.valueOf(dragoncontrollerphase.b()));
+ this.b.getDataWatcher().set(EntityEnderDragon.a, Integer.valueOf(dragoncontrollerphase.b())); // PAIL: Rename getId
}
DragonControllerManager.a.debug("Dragon is now in phase {} on the {}", new Object[] { dragoncontrollerphase, this.b.world.isClientSide ? "client" : "server"});
- this.d.d();
+ this.d.d(); // PAIL: Rename reset
}
}
@@ -42,6 +54,6 @@
this.c[i] = dragoncontrollerphase.a(this.b);
+
this.currentDragonController = this.b(dragoncontrollerphase);
if (!this.enderDragon.world.isClientSide) {
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, Integer.valueOf(dragoncontrollerphase.b()));
@@ -42,6 +59,6 @@
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
}
- return this.c[i];
+ return (T) this.c[i];
- return this.dragonControllers[i];
+ return (T) this.dragonControllers[i]; // CraftBukkit - decompile error
}
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Enchantment.java
+++ b/net/minecraft/server/Enchantment.java
@@ -16,7 +16,7 @@
@@ -18,7 +18,7 @@
}
public static int getId(Enchantment enchantment) {
@ -8,8 +8,8 @@
+ return Enchantment.enchantments.a(enchantment); // CraftBukkit - fix decompile error
}
public static Enchantment b(String s) {
@@ -135,6 +135,11 @@
@Nullable
@@ -139,6 +139,11 @@
Enchantment.enchantments.a(61, new MinecraftKey("luck_of_the_sea"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
Enchantment.enchantments.a(62, new MinecraftKey("lure"), new EnchantmentLure(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
Enchantment.enchantments.a(70, new MinecraftKey("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));

Datei anzeigen

@ -12,19 +12,19 @@
@@ -42,8 +45,18 @@
IBlockData iblockdata1 = world.getType(blockposition_mutableblockposition1);
if (iblockdata1.getMaterial() == Material.WATER && ((Integer) iblockdata1.get(BlockFluids.LEVEL)).intValue() == 0 && world.a(Blocks.de, blockposition_mutableblockposition1, false, EnumDirection.DOWN, (Entity) null, (ItemStack) null)) {
- world.setTypeUpdate(blockposition_mutableblockposition1, Blocks.de.getBlockData());
- world.a(blockposition_mutableblockposition1.h(), Blocks.de, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
if (iblockdata1.getMaterial() == Material.WATER && ((Integer) iblockdata1.get(BlockFluids.LEVEL)).intValue() == 0 && world.a(Blocks.FROSTED_ICE, blockposition_mutableblockposition1, false, EnumDirection.DOWN, (Entity) null, (ItemStack) null)) {
- world.setTypeUpdate(blockposition_mutableblockposition1, Blocks.FROSTED_ICE.getBlockData());
- world.a(blockposition_mutableblockposition1.h(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+ // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker
+ org.bukkit.block.BlockState blockState = world.getWorld().getBlockAt(blockposition_mutableblockposition1.getX(), blockposition_mutableblockposition1.getY(), blockposition_mutableblockposition1.getZ()).getState();
+ blockState.setType(CraftMagicNumbers.getMaterial(Blocks.de)); // PAIL - Rename de->FROSTED_ICE
+ blockState.setType(CraftMagicNumbers.getMaterial(Blocks.FROSTED_ICE));
+
+ EntityBlockFormEvent event = new EntityBlockFormEvent(entityliving.bukkitEntity, blockState.getBlock(), blockState);
+ world.getServer().getPluginManager().callEvent(event);
+
+ if (!event.isCancelled()) {
+ blockState.update(true);
+ world.a(blockposition_mutableblockposition1.h(), Blocks.de, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+ world.a(blockposition_mutableblockposition1.h(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+ }
+ // CraftBukkit End
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EnderDragonBattle.java
+++ b/net/minecraft/server/EnderDragonBattle.java
@@ -247,7 +247,7 @@
@@ -249,7 +249,7 @@
ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = this.f.a(this.d, tileentity.getPosition());
if (shapedetector_shapedetectorcollection != null) {
@ -9,7 +9,7 @@
if (this.o == null && blockposition.getX() == 0 && blockposition.getZ() == 0) {
this.o = blockposition;
@@ -267,7 +267,7 @@
@@ -269,7 +269,7 @@
if (shapedetector_shapedetectorcollection1 != null) {
if (this.o == null) {

Datei anzeigen

@ -48,17 +48,17 @@
private static final Logger a = LogManager.getLogger();
private static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
private static double c = 1.0D;
@@ -97,6 +136,9 @@
@@ -98,6 +137,9 @@
public boolean glowing;
private final Set<String> aF;
private boolean aG;
private final Set<String> aG;
private boolean aH;
+ public boolean valid; // CraftBukkit
+ public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
+ public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
public Entity(World world) {
this.id = Entity.entityCount++;
@@ -193,6 +235,33 @@
@@ -195,6 +237,33 @@
}
protected void setYawPitch(float f, float f1) {
@ -92,7 +92,7 @@
this.yaw = f % 360.0F;
this.pitch = f1 % 360.0F;
}
@@ -236,7 +305,7 @@
@@ -238,7 +307,7 @@
if (this.ak) {
MinecraftServer minecraftserver = this.world.getMinecraftServer();
@ -101,7 +101,7 @@
if (!this.isPassenger()) {
int i = this.V();
@@ -321,6 +390,27 @@
@@ -323,6 +392,27 @@
protected void burnFromLava() {
if (!this.fireProof) {
this.damageEntity(DamageSource.LAVA, 4.0F);
@ -129,7 +129,7 @@
this.setOnFire(15);
}
}
@@ -361,6 +451,22 @@
@@ -363,6 +453,22 @@
this.a(this.getBoundingBox().c(d0, d1, d2));
this.recalcPosition();
} else {
@ -152,7 +152,7 @@
this.world.methodProfiler.a("move");
double d3 = this.locX;
double d4 = this.locY;
@@ -585,6 +691,26 @@
@@ -587,6 +693,26 @@
block1.a(this.world, this);
}
@ -179,7 +179,7 @@
if (this.playStepSound() && !flag && !this.isPassenger()) {
double d21 = this.locX - d3;
double d22 = this.locY - d4;
@@ -595,7 +721,7 @@
@@ -597,7 +723,7 @@
}
if (block1 != null && this.onGround) {
@ -188,7 +188,7 @@
}
this.J = (float) ((double) this.J + (double) MathHelper.sqrt(d21 * d21 + d10 * d10) * 0.6D);
@@ -613,9 +739,12 @@
@@ -615,9 +741,12 @@
}
this.a(blockposition, block1);
@ -201,7 +201,7 @@
try {
this.checkBlockCollisions();
} catch (Throwable throwable) {
@@ -625,6 +754,8 @@
@@ -627,6 +756,8 @@
this.appendEntityCrashDetails(crashreportsystemdetails);
throw new ReportedException(crashreport);
}
@ -210,7 +210,7 @@
boolean flag2 = this.ah();
@@ -632,7 +763,16 @@
@@ -634,7 +765,16 @@
this.burn(1);
if (!flag2) {
++this.fireTicks;
@ -228,7 +228,7 @@
this.setOnFire(8);
}
}
@@ -745,7 +885,7 @@
@@ -748,7 +888,7 @@
return null;
}
@ -237,7 +237,7 @@
if (!this.fireProof) {
this.damageEntity(DamageSource.FIRE, (float) i);
}
@@ -911,6 +1051,13 @@
@@ -914,6 +1054,13 @@
}
public void spawnIn(World world) {
@ -251,7 +251,7 @@
this.world = world;
}
@@ -1104,6 +1251,18 @@
@@ -1107,6 +1254,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}));
@ -270,7 +270,7 @@
nbttagcompound.set("Rotation", this.a(new float[] { this.yaw, this.pitch}));
nbttagcompound.setFloat("FallDistance", this.fallDistance);
nbttagcompound.setShort("Fire", (short) this.fireTicks);
@@ -1113,6 +1272,12 @@
@@ -1116,6 +1275,12 @@
nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
nbttagcompound.a("UUID", this.getUniqueID());
@ -283,7 +283,7 @@
if (this.getCustomName() != null && !this.getCustomName().isEmpty()) {
nbttagcompound.setString("CustomName", this.getCustomName());
}
@@ -1183,6 +1348,8 @@
@@ -1187,6 +1352,8 @@
this.motX = nbttaglist1.e(0);
this.motY = nbttaglist1.e(1);
this.motZ = nbttaglist1.e(2);
@ -292,7 +292,7 @@
if (Math.abs(this.motX) > 10.0D) {
this.motX = 0.0D;
}
@@ -1194,6 +1361,7 @@
@@ -1198,6 +1365,7 @@
if (Math.abs(this.motZ) > 10.0D) {
this.motZ = 0.0D;
}
@ -300,7 +300,7 @@
this.lastX = this.M = this.locX = nbttaglist.e(0);
this.lastY = this.N = this.locY = nbttaglist.e(1);
@@ -1241,6 +1409,58 @@
@@ -1246,6 +1414,58 @@
this.setPosition(this.locX, this.locY, this.locZ);
}
@ -359,7 +359,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
@@ -1302,6 +1522,12 @@
@@ -1307,6 +1527,12 @@
public EntityItem a(ItemStack itemstack, float f) {
if (itemstack.count != 0 && itemstack.getItem() != null) {
@ -372,8 +372,8 @@
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
entityitem.q();
@@ -1422,6 +1648,24 @@
if (entity.by() != this) {
@@ -1428,6 +1654,24 @@
if (entity.bz() != this) {
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
} else {
+ // CraftBukkit start
@ -394,11 +394,11 @@
+ }
+ }
+ // CraftBukkit end
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bt() instanceof EntityHuman)) {
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bu() instanceof EntityHuman)) {
this.passengers.add(0, entity);
} else {
@@ -1435,6 +1679,22 @@
if (entity.by() == this) {
@@ -1441,6 +1685,22 @@
if (entity.bz() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else {
+ // CraftBukkit start
@ -420,7 +420,7 @@
this.passengers.remove(entity);
entity.j = 60;
}
@@ -1577,10 +1837,38 @@
@@ -1584,10 +1844,38 @@
}
public void onLightningStrike(EntityLightning entitylightning) {
@ -461,7 +461,7 @@
}
}
@@ -1715,19 +2003,67 @@
@@ -1722,19 +2010,67 @@
if (!this.world.isClientSide && !this.dead) {
this.world.methodProfiler.a("changeDimension");
MinecraftServer minecraftserver = this.h();
@ -532,7 +532,7 @@
BlockPosition blockposition;
if (i == 1) {
@@ -1756,12 +2092,18 @@
@@ -1763,12 +2099,18 @@
blockposition = new BlockPosition(this);
}
@ -552,7 +552,7 @@
if (j == 1 && i == 1) {
BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn());
@@ -1769,6 +2111,7 @@
@@ -1776,6 +2118,7 @@
} else {
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
}
@ -560,7 +560,7 @@
boolean flag = entity.attachedToPlayer;
@@ -1776,6 +2119,14 @@
@@ -1783,6 +2126,14 @@
worldserver1.addEntity(entity);
entity.attachedToPlayer = flag;
worldserver1.entityJoinedWorld(entity, false);
@ -575,7 +575,7 @@
}
this.dead = true;
@@ -1881,6 +2232,11 @@
@@ -1893,6 +2244,11 @@
}
public void setCustomName(String s) {
@ -584,10 +584,10 @@
+ s = s.substring(0, 256);
+ }
+ // CraftBukkit end
this.datawatcher.set(Entity.az, s);
this.datawatcher.set(Entity.aA, s);
}
@@ -1938,7 +2294,26 @@
@@ -1950,7 +2306,26 @@
}
public void a(AxisAlignedBB axisalignedbb) {
@ -615,8 +615,8 @@
}
public float getHeadHeight() {
@@ -2110,7 +2485,7 @@
for (Iterator iterator = this.bu().iterator(); iterator.hasNext(); entity.a(oclass, set)) {
@@ -2124,7 +2499,7 @@
for (Iterator iterator = this.bv().iterator(); iterator.hasNext(); entity.a(oclass, set)) {
entity = (Entity) iterator.next();
if (oclass.isAssignableFrom(entity.getClass())) {
- set.add(entity);

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/EntityAgeable.java
+++ b/net/minecraft/server/EntityAgeable.java
@@ -8,6 +8,7 @@
@@ -10,6 +10,7 @@
protected int c;
private float bw = -1.0F;
private float bx;
private float bx = -1.0F;
private float by;
+ public boolean ageLocked; // CraftBukkit
public EntityAgeable(World world) {
super(world);
@@ -26,13 +27,16 @@
@@ -28,13 +29,16 @@
if (entityageable != null) {
entityageable.setAgeRaw(-24000);
entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F);
@ -26,7 +26,7 @@
}
}
}
@@ -95,12 +99,14 @@
@@ -97,12 +101,14 @@
super.b(nbttagcompound);
nbttagcompound.setInt("Age", this.getAge());
nbttagcompound.setInt("ForcedAge", this.b);
@ -41,7 +41,7 @@
}
public void a(DataWatcherObject<?> datawatcherobject) {
@@ -113,7 +119,7 @@
@@ -115,7 +121,7 @@
public void n() {
super.n();

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityAnimal.java
+++ b/net/minecraft/server/EntityAnimal.java
@@ -38,6 +38,9 @@
@@ -40,6 +40,9 @@
}
@ -10,7 +10,7 @@
public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable(damagesource)) {
return false;
@@ -46,6 +49,7 @@
@@ -48,6 +51,7 @@
return super.damageEntity(damagesource, f);
}
}

Datei anzeigen

@ -9,15 +9,15 @@
+import org.bukkit.entity.LivingEntity; // CraftBukkit
+
import java.util.Map.Entry;
import javax.annotation.Nullable;
public class EntityAreaEffectCloud extends Entity {
@@ -91,6 +95,22 @@
@@ -92,6 +96,22 @@
}
+ // CraftBukkit start accessor methods
+ public void refreshEffects() {
+ if (!this.au) {
+ if (!this.hasColor) {
+ this.getDataWatcher().set(EntityAreaEffectCloud.b, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.e, (Collection) this.effects)))); // PAIL: rename
+ }
+ }
@ -34,7 +34,7 @@
public int getColor() {
return ((Integer) this.getDataWatcher().get(EntityAreaEffectCloud.b)).intValue();
}
@@ -237,6 +257,7 @@
@@ -238,6 +258,7 @@
if (!list.isEmpty()) {
Iterator iterator2 = list.iterator();
@ -42,7 +42,7 @@
while (iterator2.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator2.next();
@@ -246,6 +267,17 @@
@@ -247,6 +268,17 @@
double d2 = d0 * d0 + d1 * d1;
if (d2 <= (double) (f * f)) {

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/EntityArmorStand.java
+++ b/net/minecraft/server/EntityArmorStand.java
@@ -4,6 +4,15 @@
import java.util.Arrays;
@@ -5,6 +5,15 @@
import java.util.List;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.inventory.EquipmentSlot;
@ -15,10 +15,10 @@
+
public class EntityArmorStand extends EntityLiving {
private static final Vector3f bp = new Vector3f(0.0F, 0.0F, 0.0F);
@@ -360,6 +369,21 @@
if (itemstack1 == null || (this.bz & 1 << enumitemslot.c() + 8) == 0) {
if (itemstack1 != null || (this.bz & 1 << enumitemslot.c() + 16) == 0) {
private static final Vector3f bq = new Vector3f(0.0F, 0.0F, 0.0F);
@@ -362,6 +371,21 @@
if (itemstack1 == null || (this.bA & 1 << enumitemslot.c() + 8) == 0) {
if (itemstack1 != null || (this.bA & 1 << enumitemslot.c() + 16) == 0) {
ItemStack itemstack2;
+ // CraftBukkit start
+ org.bukkit.inventory.ItemStack armorStandItem = CraftItemStack.asCraftMirror(itemstack1);
@ -38,7 +38,7 @@
if (entityhuman.abilities.canInstantlyBuild && (itemstack1 == null || itemstack1.getItem() == Item.getItemOf(Blocks.AIR)) && itemstack != null) {
itemstack2 = itemstack.cloneItemStack();
@@ -381,6 +405,11 @@
@@ -383,6 +407,11 @@
}
public boolean damageEntity(DamageSource damagesource, float f) {

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/EntityArrow.java
+++ b/net/minecraft/server/EntityArrow.java
@@ -4,6 +4,12 @@
import com.google.common.base.Predicates;
@@ -5,6 +5,12 @@
import java.util.List;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.entity.LivingEntity;
@ -13,7 +13,7 @@
public abstract class EntityArrow extends Entity implements IProjectile {
private static final Predicate<Entity> f = Predicates.and(new Predicate[] { IEntitySelector.e, IEntitySelector.a, new Predicate() {
@@ -49,6 +55,7 @@
@@ -50,6 +56,7 @@
public EntityArrow(World world, EntityLiving entityliving) {
this(world, entityliving.locX, entityliving.locY + (double) entityliving.getHeadHeight() - 0.10000000149011612D, entityliving.locZ);
this.shooter = entityliving;
@ -21,7 +21,7 @@
if (entityliving instanceof EntityHuman) {
this.fromPlayer = EntityArrow.PickupStatus.ALLOWED;
}
@@ -228,7 +235,7 @@
@@ -229,7 +236,7 @@
protected void a(MovingObjectPosition movingobjectposition) {
Entity entity = movingobjectposition.entity;
@ -30,7 +30,7 @@
if (entity != null) {
float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
int i = MathHelper.f((double) f * this.damage);
@@ -245,11 +252,18 @@
@@ -246,11 +253,18 @@
damagesource = DamageSource.arrow(this, this.shooter);
}
@ -51,7 +51,7 @@
if (entity instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving) entity;
@@ -395,6 +409,20 @@
@@ -397,6 +411,20 @@
public void d(EntityHuman entityhuman) {
if (!this.world.isClientSide && this.inGround && this.shake <= 0) {
@ -72,7 +72,7 @@
boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild;
if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(this.j())) {
@@ -453,6 +481,12 @@
@@ -455,6 +483,12 @@
return (b0 & 1) != 0;
}

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/EntityBoat.java
+++ b/net/minecraft/server/EntityBoat.java
@@ -4,6 +4,15 @@
import java.util.ArrayList;
@@ -5,6 +5,15 @@
import java.util.List;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.Location;
@ -16,9 +16,9 @@
public class EntityBoat extends Entity {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityBoat.class, DataWatcherRegistry.b);
@@ -31,6 +40,14 @@
private EntityBoat.EnumStatus aG;
private double aH;
@@ -32,6 +41,14 @@
private EntityBoat.EnumStatus aH;
private double aI;
+ // CraftBukkit start
+ // PAIL: Some of these haven't worked since a few updates, and since 1.9 they are less and less applicable.
@ -31,7 +31,7 @@
public EntityBoat(World world) {
super(world);
this.f = new float[2];
@@ -47,6 +64,7 @@
@@ -48,6 +65,7 @@
this.lastX = d0;
this.lastY = d1;
this.lastZ = d2;
@ -39,7 +39,7 @@
}
protected boolean playStepSound() {
@@ -88,6 +106,19 @@
@@ -91,6 +109,19 @@
if (damagesource instanceof EntityDamageSourceIndirect && damagesource.getEntity() != null && this.w(damagesource.getEntity())) {
return false;
} else {
@ -59,7 +59,7 @@
this.d(-this.q());
this.b(10);
this.setDamage(this.n() + f * 10.0F);
@@ -95,6 +126,15 @@
@@ -98,6 +129,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.n() > 40.0F) {
@ -75,7 +75,7 @@
if (!flag && this.world.getGameRules().getBoolean("doEntityDrops")) {
this.a(this.j(), 1, 0.0F);
}
@@ -112,9 +152,25 @@
@@ -115,9 +155,25 @@
public void collide(Entity entity) {
if (entity instanceof EntityBoat) {
if (entity.getBoundingBox().b < this.getBoundingBox().e) {
@ -101,16 +101,16 @@
super.collide(entity);
}
@@ -151,6 +207,8 @@
@@ -154,6 +210,8 @@
return this.getDirection().e();
}
+ private Location lastLocation; // CraftBukkit
+
public void m() {
this.aG = this.aF;
this.aF = this.t();
@@ -171,7 +229,6 @@
this.aH = this.aG;
this.aG = this.t();
@@ -174,7 +232,6 @@
if (this.n() > 0.0F) {
this.setDamage(this.n() - 1.0F);
}
@ -118,7 +118,7 @@
this.lastX = this.locX;
this.lastY = this.locY;
this.lastZ = this.locZ;
@@ -195,6 +252,22 @@
@@ -198,6 +255,22 @@
this.motZ = 0.0D;
}
@ -141,7 +141,7 @@
for (int i = 0; i <= 1; ++i) {
if (this.a(i)) {
this.f[i] = (float) ((double) this.f[i] + 0.01D);
@@ -591,6 +664,11 @@
@@ -595,6 +668,11 @@
this.e(this.fallDistance, 1.0F);
if (!this.world.isClientSide && !this.dead) {
@ -153,7 +153,7 @@
this.die();
if (this.world.getGameRules().getBoolean("doEntityDrops")) {
int i;
@@ -604,6 +682,7 @@
@@ -608,6 +686,7 @@
}
}
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityChicken.java
+++ b/net/minecraft/server/EntityChicken.java
@@ -43,6 +43,11 @@
@@ -44,6 +44,11 @@
}
public void n() {
@ -10,15 +10,15 @@
+ }
+ // CraftBukkit end
super.n();
this.bz = this.bv;
this.bx = this.bw;
@@ -60,7 +65,9 @@
this.bv += this.bA * 2.0F;
if (!this.world.isClientSide && !this.isBaby() && !this.isChickenJockey() && --this.bB <= 0) {
this.bA = this.bw;
this.by = this.bx;
@@ -61,7 +66,9 @@
this.bw += this.bB * 2.0F;
if (!this.world.isClientSide && !this.isBaby() && !this.isChickenJockey() && --this.bC <= 0) {
this.a(SoundEffects.aa, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
+ this.forceDrops = true; // CraftBukkit
this.a(Items.EGG, 1);
+ this.forceDrops = false; // CraftBukkit
this.bB = this.random.nextInt(6000) + 6000;
this.bC = this.random.nextInt(6000) + 6000;
}

Datei anzeigen

@ -1,19 +1,19 @@
--- a/net/minecraft/server/EntityCow.java
+++ b/net/minecraft/server/EntityCow.java
@@ -1,5 +1,10 @@
@@ -1,6 +1,10 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+// CraftBukkit end
+
public class EntityCow extends EntityAnimal {
public EntityCow(World world) {
@@ -50,12 +55,22 @@
@@ -53,12 +57,22 @@
public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
public boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) {
if (itemstack != null && itemstack.getItem() == Items.BUCKET && !entityhuman.abilities.canInstantlyBuild && !this.isBaby()) {
+ // CraftBukkit start - Got milk?
+ org.bukkit.Location loc = this.getBukkitEntity().getLocation();

Datei anzeigen

@ -10,7 +10,7 @@
+
public abstract class EntityCreature extends EntityInsentient {
public static final UUID bt = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A");
public static final UUID bu = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A");
@@ -71,6 +75,7 @@
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
@ -26,4 +26,4 @@
+ this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
this.unleash(true, true);
}
} else if (!this.isLeashed() && this.bv) {
} else if (!this.isLeashed() && this.bw) {

Datei anzeigen

@ -1,17 +1,17 @@
--- a/net/minecraft/server/EntityCreeper.java
+++ b/net/minecraft/server/EntityCreeper.java
@@ -1,5 +1,10 @@
@@ -1,6 +1,10 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.ExplosionPrimeEvent;
+// CraftBukkit end
+
public class EntityCreeper extends EntityMonster {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.b);
@@ -117,7 +122,7 @@
@@ -119,7 +123,7 @@
}
public void die(DamageSource damagesource) {
@ -20,7 +20,7 @@
if (this.world.getGameRules().getBoolean("doMobLoot")) {
if (damagesource.getEntity() instanceof EntitySkeleton) {
int i = Item.getId(Items.RECORD_13);
@@ -130,6 +135,7 @@
@@ -132,6 +136,7 @@
this.a(new ItemStack(Items.SKULL, 1, 4), 0.0F);
}
}
@ -28,7 +28,7 @@
}
@@ -155,8 +161,18 @@
@@ -158,8 +163,18 @@
public void onLightningStrike(EntityLightning entitylightning) {
super.onLightningStrike(entitylightning);
@ -45,20 +45,20 @@
}
+ // CraftBukkit end
protected boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
protected boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) {
if (itemstack != null && itemstack.getItem() == Items.FLINT_AND_STEEL) {
@@ -177,9 +193,17 @@
@@ -180,9 +195,17 @@
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
float f = this.isPowered() ? 2.0F : 1.0F;
- this.aT = true;
- this.aU = true;
- this.world.explode(this, this.locX, this.locY, this.locZ, (float) this.explosionRadius * f, flag);
- this.die();
+ // CraftBukkit start
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false);
+ this.world.getServer().getPluginManager().callEvent(event);
+ if (!event.isCancelled()) {
+ this.aT = true;
+ this.aU = true;
+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag);
+ this.die();
+ } else {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityDamageSourceIndirect.java
+++ b/net/minecraft/server/EntityDamageSourceIndirect.java
@@ -25,4 +25,10 @@
@@ -29,4 +29,10 @@
return itemstack != null && itemstack.hasName() && LocaleI18n.c(s1) ? new ChatMessage(s1, new Object[] { entityliving.getScoreboardDisplayName(), ichatbasecomponent, itemstack.B()}) : new ChatMessage(s, new Object[] { entityliving.getScoreboardDisplayName(), ichatbasecomponent});
}

Datei anzeigen

@ -1,8 +1,8 @@
--- a/net/minecraft/server/EntityEnderCrystal.java
+++ b/net/minecraft/server/EntityEnderCrystal.java
@@ -2,6 +2,11 @@
@@ -3,6 +3,11 @@
import com.google.common.base.Optional;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@ -12,7 +12,7 @@
public class EntityEnderCrystal extends Entity {
private static final DataWatcherObject<Optional<BlockPosition>> b = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.k);
@@ -38,7 +43,11 @@
@@ -39,7 +44,11 @@
BlockPosition blockposition = new BlockPosition(this);
if (this.world.worldProvider instanceof WorldProviderTheEnd && this.world.getType(blockposition).getBlock() != Blocks.FIRE) {
@ -25,7 +25,7 @@
}
}
@@ -74,9 +83,22 @@
@@ -75,9 +84,22 @@
return false;
} else {
if (!this.dead && !this.world.isClientSide) {

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/EntityEnderDragon.java
+++ b/net/minecraft/server/EntityEnderDragon.java
@@ -4,7 +4,12 @@
import java.util.List;
@@ -5,7 +5,12 @@
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
@ -12,25 +12,25 @@
+// PAIL: Fixme
public class EntityEnderDragon extends EntityInsentient implements IComplex, IMonster {
private static final Logger bH = LogManager.getLogger();
@@ -32,6 +37,7 @@
private final PathPoint[] bM = new PathPoint[24];
private final int[] bN = new int[24];
private final Path bO = new Path();
private static final Logger bI = LogManager.getLogger();
@@ -33,6 +38,7 @@
private final PathPoint[] bN = new PathPoint[24];
private final int[] bO = new int[24];
private final Path bP = new Path();
+ private Explosion explosionSource = new Explosion(null, this, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, true); // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
public EntityEnderDragon(World world) {
super(world);
@@ -169,7 +175,7 @@
@@ -170,7 +176,7 @@
Vec3D vec3d = idragoncontroller.g();
- if (vec3d != null) {
+ if (vec3d != null && idragoncontroller.i() != DragonControllerPhase.k) { // CraftBukkit - Don't move when hovering
+ if (vec3d != null && idragoncontroller.getControllerPhase() != DragonControllerPhase.k) { // CraftBukkit - Don't move when hovering // PAIL: rename
d0 = vec3d.x - this.locX;
d1 = vec3d.y - this.locY;
d2 = vec3d.z - this.locZ;
@@ -308,7 +314,14 @@
@@ -309,7 +315,14 @@
if (this.currentEnderCrystal.dead) {
this.currentEnderCrystal = null;
} else if (this.ticksLived % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
@ -46,7 +46,7 @@
}
}
@@ -381,6 +394,10 @@
@@ -382,6 +395,10 @@
int j1 = MathHelper.floor(axisalignedbb.f);
boolean flag = false;
boolean flag1 = false;
@ -57,7 +57,7 @@
for (int k1 = i; k1 <= l; ++k1) {
for (int l1 = j; l1 <= i1; ++l1) {
@@ -394,7 +411,11 @@
@@ -395,7 +412,11 @@
flag = true;
} else if (block != Blocks.BARRIER && block != Blocks.OBSIDIAN && block != Blocks.END_STONE && block != Blocks.BEDROCK && block != Blocks.END_PORTAL && block != Blocks.END_PORTAL_FRAME) {
if (block != Blocks.COMMAND_BLOCK && block != Blocks.dc && block != Blocks.dd && block != Blocks.IRON_BARS && block != Blocks.END_GATEWAY) {
@ -70,7 +70,7 @@
} else {
flag = true;
}
@@ -406,6 +427,41 @@
@@ -407,6 +428,41 @@
}
}

Datei anzeigen

@ -9,10 +9,10 @@
import java.util.Random;
import java.util.Set;
import java.util.UUID;
@@ -55,7 +57,17 @@
@@ -56,7 +58,17 @@
}
public void setGoalTarget(EntityLiving entityliving) {
public void setGoalTarget(@Nullable EntityLiving entityliving) {
- super.setGoalTarget(entityliving);
+ // CraftBukkit start - fire event
+ setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
@ -28,7 +28,7 @@
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
if (entityliving == null) {
@@ -69,6 +81,7 @@
@@ -70,6 +82,7 @@
attributeinstance.b(EntityEnderman.b);
}
}
@ -36,7 +36,7 @@
}
@@ -306,8 +319,12 @@
@@ -309,8 +322,12 @@
boolean flag = movingobjectposition != null && movingobjectposition.a().equals(blockposition);
if (EntityEnderman.c.contains(block) && flag) {
@ -51,7 +51,7 @@
}
}
@@ -337,8 +354,12 @@
@@ -340,8 +357,12 @@
IBlockData iblockdata2 = this.a.getCarried();
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2.getBlock(), iblockdata, iblockdata1)) {

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/EntityFallingBlock.java
+++ b/net/minecraft/server/EntityFallingBlock.java
@@ -4,6 +4,8 @@
import java.util.ArrayList;
@@ -5,6 +5,8 @@
import java.util.Iterator;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class EntityFallingBlock extends Entity {
private IBlockData block;
@@ -64,7 +66,7 @@
@@ -65,7 +67,7 @@
if (this.ticksLived++ == 0) {
blockposition = new BlockPosition(this);
@ -18,7 +18,7 @@
this.world.setAir(blockposition);
} else if (!this.world.isClientSide) {
this.die();
@@ -84,7 +86,7 @@
@@ -85,7 +87,7 @@
if (BlockFalling.i(this.world.getType(new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ)))) {
this.onGround = false;
@ -27,7 +27,7 @@
}
this.motX *= 0.699999988079071D;
@@ -93,7 +95,13 @@
@@ -94,7 +96,13 @@
if (iblockdata.getBlock() != Blocks.PISTON_EXTENSION) {
this.die();
if (!this.f) {
@ -42,7 +42,7 @@
if (block instanceof BlockFalling) {
((BlockFalling) block).a_(this.world, blockposition);
}
@@ -152,7 +160,9 @@
@@ -151,7 +159,9 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityFireworks.java
+++ b/net/minecraft/server/EntityFireworks.java
@@ -79,7 +79,7 @@
@@ -80,7 +80,7 @@
}
if (!this.world.isClientSide && this.ticksFlown > this.expectedLifespan) {

Datei anzeigen

@ -22,9 +22,9 @@
this.hooked = movingobjectposition.entity;
this.getDataWatcher().set(EntityFishingHook.c, Integer.valueOf(this.hooked.getId() + 1));
@@ -266,6 +273,10 @@
if (this.au <= 0) {
this.av = 0;
if (this.av <= 0) {
this.aw = 0;
this.ax = 0;
+ // CraftBukkit start
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT);
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent);
@ -33,9 +33,9 @@
} else {
double d10;
@@ -278,6 +289,13 @@
if (this.aw > 0) {
this.aw -= l;
if (this.aw <= 0) {
if (this.ax > 0) {
this.ax -= l;
if (this.ax <= 0) {
+ // CraftBukkit start
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.BITE);
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent);

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