13
0
geforkt von Mirrors/Paper

Update to Minecraft 1.12-pre5

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2017-05-19 21:00:13 +10:00
Ursprung 5284eb89a3
Commit 530fe41851
47 geänderte Dateien mit 222 neuen und 283 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/AdvancementDataPlayer.java --- a/net/minecraft/server/AdvancementDataPlayer.java
+++ b/net/minecraft/server/AdvancementDataPlayer.java +++ b/net/minecraft/server/AdvancementDataPlayer.java
@@ -29,7 +29,7 @@ @@ -30,7 +30,7 @@
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
private static final Gson b = (new GsonBuilder()).registerTypeAdapter(AdvancementProgress.class, new AdvancementProgress.a()).registerTypeAdapter(MinecraftKey.class, new MinecraftKey.a()).setPrettyPrinting().create(); private static final Gson b = (new GsonBuilder()).registerTypeAdapter(AdvancementProgress.class, new AdvancementProgress.a()).registerTypeAdapter(MinecraftKey.class, new MinecraftKey.a()).setPrettyPrinting().create();
@ -9,7 +9,7 @@
}; };
private final MinecraftServer d; private final MinecraftServer d;
private final File e; private final File e;
@@ -88,7 +88,7 @@ @@ -92,7 +92,7 @@
Iterator iterator = this.data.entrySet().iterator(); Iterator iterator = this.data.entrySet().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@ -18,7 +18,7 @@
if (((AdvancementProgress) entry.getValue()).isDone()) { if (((AdvancementProgress) entry.getValue()).isDone()) {
arraylist.add(entry.getKey()); arraylist.add(entry.getKey());
@@ -124,13 +124,15 @@ @@ -128,13 +128,15 @@
if (this.e.isFile()) { if (this.e.isFile()) {
try { try {
String s = Files.toString(this.e, StandardCharsets.UTF_8); String s = Files.toString(this.e, StandardCharsets.UTF_8);
@ -36,7 +36,7 @@
Iterator iterator = ((List) stream.collect(Collectors.toList())).iterator(); Iterator iterator = ((List) stream.collect(Collectors.toList())).iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -138,7 +140,11 @@ @@ -142,7 +144,11 @@
Advancement advancement = this.d.getAdvancementData().a((MinecraftKey) entry.getKey()); Advancement advancement = this.d.getAdvancementData().a((MinecraftKey) entry.getKey());
if (advancement == null) { if (advancement == null) {
@ -49,7 +49,7 @@
} else { } else {
this.a(advancement, (AdvancementProgress) entry.getValue()); this.a(advancement, (AdvancementProgress) entry.getValue());
} }
@@ -190,6 +196,7 @@ @@ -194,6 +200,7 @@
this.i.add(advancement); this.i.add(advancement);
flag = true; flag = true;
if (!flag1 && advancementprogress.isDone()) { if (!flag1 && advancementprogress.isDone()) {

Datei anzeigen

@ -18,13 +18,13 @@
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.setTypeAndData(blockposition, this.A(iblockdata), 2); world.setTypeAndData(blockposition, this.z(iblockdata), 2);
} else if (!this.d) { } else if (!this.d) {
+ // CraftBukkit start + // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) { + if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.setTypeAndData(blockposition, this.z(iblockdata), 2); world.setTypeAndData(blockposition, this.y(iblockdata), 2);
if (!flag) { if (!flag) {
world.a(blockposition, this.z(iblockdata).getBlock(), this.F(iblockdata), -1); world.a(blockposition, this.y(iblockdata).getBlock(), this.E(iblockdata), -1);

Datei anzeigen

@ -15,7 +15,7 @@
} else { } else {
- boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || world.isBlockIndirectlyPowered(blockposition3); - boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || world.isBlockIndirectlyPowered(blockposition3);
- if (block != this && (flag1 || block.getBlockData().n()) && flag1 != ((Boolean) iblockdata2.get(BlockDoor.POWERED)).booleanValue()) { - if (block != this && (flag1 || block.getBlockData().m()) && flag1 != ((Boolean) iblockdata2.get(BlockDoor.POWERED)).booleanValue()) {
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.World bworld = world.getWorld(); + org.bukkit.World bworld = world.getWorld();
+ org.bukkit.block.Block bukkitBlock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + org.bukkit.block.Block bukkitBlock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());

Datei anzeigen

@ -12,7 +12,7 @@
@@ -37,6 +39,10 @@ @@ -37,6 +39,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.bd() && !world.isClientSide && entity.getBoundingBox().c(iblockdata.d(world, blockposition).a(blockposition))) { if (!entity.isPassenger() && !entity.isVehicle() && entity.bd() && !world.isClientSide && entity.getBoundingBox().c(iblockdata.e(world, blockposition).a(blockposition))) {
+ // CraftBukkit start - Entity in portal + // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);

Datei anzeigen

@ -25,7 +25,7 @@
@@ -108,7 +114,7 @@ @@ -108,7 +114,7 @@
int i = ((Integer) iblockdata.get(BlockFire.AGE)).intValue(); int i = ((Integer) iblockdata.get(BlockFire.AGE)).intValue();
if (!flag && world.Y() && this.b(world, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) { if (!flag && world.isRaining() && this.b(world, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) {
- world.setAir(blockposition); - world.setAir(blockposition);
+ fireExtinguished(world, blockposition); // CraftBukkit - extinguished by rain + fireExtinguished(world, blockposition); // CraftBukkit - extinguished by rain
} else { } else {
@ -34,7 +34,7 @@
@@ -119,14 +125,14 @@ @@ -119,14 +125,14 @@
if (!flag) { if (!flag) {
if (!this.c(world, blockposition)) { if (!this.c(world, blockposition)) {
if (!world.getType(blockposition.down()).r() || i > 3) { if (!world.getType(blockposition.down()).q() || i > 3) {
- world.setAir(blockposition); - world.setAir(blockposition);
+ fireExtinguished(world, blockposition); // CraftBukkit + fireExtinguished(world, blockposition); // CraftBukkit
} }
@ -126,7 +126,7 @@
@@ -276,7 +315,7 @@ @@ -276,7 +315,7 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) { public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) {
if (!world.getType(blockposition.down()).r() && !this.c(world, blockposition)) { if (!world.getType(blockposition.down()).q() && !this.c(world, blockposition)) {
- world.setAir(blockposition); - world.setAir(blockposition);
+ fireExtinguished(world, blockposition); // CraftBukkit - fuel block gone + fireExtinguished(world, blockposition); // CraftBukkit - fuel block gone
} }
@ -135,7 +135,7 @@
@@ -284,7 +323,7 @@ @@ -284,7 +323,7 @@
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) { public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
if (world.worldProvider.getDimensionManager().getDimensionID() > 0 || !Blocks.PORTAL.b(world, blockposition)) { if (world.worldProvider.getDimensionManager().getDimensionID() > 0 || !Blocks.PORTAL.b(world, blockposition)) {
if (!world.getType(blockposition.down()).r() && !this.c(world, blockposition)) { if (!world.getType(blockposition.down()).q() && !this.c(world, blockposition)) {
- world.setAir(blockposition); - world.setAir(blockposition);
+ fireExtinguished(world, blockposition); // CraftBukkit - fuel block broke + fireExtinguished(world, blockposition); // CraftBukkit - fuel block broke
} else { } else {

Datei anzeigen

@ -42,8 +42,8 @@
} }
} }
- if (!flag1 && iblockdata1.getMaterial() != Material.AIR && a(iblockdata1, world, blockposition1, enumdirection.opposite(), false, enumdirection) && (iblockdata1.p() == EnumPistonReaction.NORMAL || block == Blocks.PISTON || block == Blocks.STICKY_PISTON)) { - if (!flag1 && iblockdata1.getMaterial() != Material.AIR && a(iblockdata1, world, blockposition1, enumdirection.opposite(), false, enumdirection) && (iblockdata1.o() == EnumPistonReaction.NORMAL || block == Blocks.PISTON || block == Blocks.STICKY_PISTON)) {
+ if (!flag1 && a(iblockdata1, world, blockposition1, enumdirection.opposite(), false, enumdirection) && (iblockdata1.p() == EnumPistonReaction.NORMAL || block == Blocks.PISTON || block == Blocks.STICKY_PISTON)) { // CraftBukkit - remove 'block.getMaterial() != Material.AIR' condition + if (!flag1 && a(iblockdata1, world, blockposition1, enumdirection.opposite(), false, enumdirection) && (iblockdata1.o() == EnumPistonReaction.NORMAL || block == Blocks.PISTON || block == Blocks.STICKY_PISTON)) { // CraftBukkit - remove 'block.getMaterial() != Material.AIR' condition
this.a(world, blockposition, enumdirection, false); this.a(world, blockposition, enumdirection, false);
} }
} else { } else {

Datei anzeigen

@ -13,7 +13,7 @@
@@ -43,7 +46,8 @@ @@ -43,7 +46,8 @@
} }
if (i > 0 && !world.getType(blockposition1.up()).m()) { if (i > 0 && !world.getType(blockposition1.up()).l()) {
- Entity entity = ItemMonsterEgg.a(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D); - Entity entity = ItemMonsterEgg.a(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D);
+ // CraftBukkit - set spawn reason to NETHER_PORTAL + // CraftBukkit - set spawn reason to NETHER_PORTAL
+ Entity entity = ItemMonsterEgg.spawnCreature(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); + Entity entity = ItemMonsterEgg.spawnCreature(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);

Datei anzeigen

@ -21,7 +21,7 @@
+ public static TreeType treeType; // CraftBukkit + public static TreeType treeType; // CraftBukkit
protected BlockSapling() { protected BlockSapling() {
this.y(this.blockStateList.getBlockData().set(BlockSapling.TYPE, BlockWood.EnumLogVariant.OAK).set(BlockSapling.STAGE, Integer.valueOf(0))); this.x(this.blockStateList.getBlockData().set(BlockSapling.TYPE, BlockWood.EnumLogVariant.OAK).set(BlockSapling.STAGE, Integer.valueOf(0)));
@@ -25,7 +35,30 @@ @@ -25,7 +35,30 @@
if (!world.isClientSide) { if (!world.isClientSide) {
super.b(world, blockposition, iblockdata, random); super.b(world, blockposition, iblockdata, random);

Datei anzeigen

@ -11,7 +11,7 @@
@@ -91,6 +92,19 @@ @@ -91,6 +92,19 @@
boolean flag = world.isBlockIndirectlyPowered(blockposition); boolean flag = world.isBlockIndirectlyPowered(blockposition);
if (flag || block.getBlockData().n()) { if (flag || block.getBlockData().m()) {
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.World bworld = world.getWorld(); + org.bukkit.World bworld = world.getWorld();
+ org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());

Datei anzeigen

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

Datei anzeigen

@ -26,7 +26,7 @@
if (minecraftserver != null && minecraftserver.M() && minecraftserver.getEnableCommandBlock()) { if (minecraftserver != null && minecraftserver.M() && minecraftserver.getEnableCommandBlock()) {
try { try {
this.f = null; this.f = null;
- this.d = minecraftserver.getCommandHandler().b(this, this.g); - this.d = minecraftserver.getCommandHandler().a(this, this.g);
+ // CraftBukkit start - Handle command block commands using Bukkit dispatcher + // CraftBukkit start - Handle command block commands using Bukkit dispatcher
+ this.d = executeSafely(this, sender, this.g); + this.d = executeSafely(this, sender, this.g);
+ // CraftBukkit end + // CraftBukkit end

Datei anzeigen

@ -11,27 +11,16 @@
public class CommandExecute extends CommandAbstract { public class CommandExecute extends CommandAbstract {
@@ -59,7 +63,10 @@ @@ -59,26 +63,59 @@
} }
String s = a(astring, b0); String s = a(astring, b0);
- ICommandListener icommandlistener1 = new ICommandListener() { - CommandListenerWrapper commandlistenerwrapper = CommandListenerWrapper.a(icommandlistener).a(entity, new Vec3D(d0, d1, d2)).a(minecraftserver.worldServer[0].getGameRules().getBoolean("commandBlockOutput"));
+ // CraftBukkit start - name class + CommandListenerWrapper commandlistenerwrapper = CommandListenerWrapper.a(icommandlistener).a(entity, new Vec3D(d0, d1, d2)).a(minecraftserver.worlds.get(0).getGameRules().getBoolean("commandBlockOutput")); // CraftBukkit
+ class ProxyListener implements ICommandListener {
+ private final ICommandListener base = icommandlistener;
+ // CraftBukkit end
public String getName() {
return entity.getName();
}
@@ -104,25 +111,59 @@
return entity.C_();
}
};
+ ICommandListener icommandlistener1 = new ProxyListener(); // CraftBukkit
ICommandHandler icommandhandler = minecraftserver.getCommandHandler(); ICommandHandler icommandhandler = minecraftserver.getCommandHandler();
try { try {
- int i = icommandhandler.b(icommandlistener1, s); - int i = icommandhandler.a(commandlistenerwrapper, s);
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.command.CommandSender sender = null; + org.bukkit.command.CommandSender sender = null;
+ ICommandListener listener = icommandlistener; + ICommandListener listener = icommandlistener;
@ -42,8 +31,8 @@
+ sender = minecraftserver.remoteConsole; + sender = minecraftserver.remoteConsole;
+ } else if (listener instanceof CommandBlockListenerAbstract) { + } else if (listener instanceof CommandBlockListenerAbstract) {
+ sender = ((CommandBlockListenerAbstract) listener).sender; + sender = ((CommandBlockListenerAbstract) listener).sender;
+ } else if (listener instanceof ProxyListener) { + } else if (listener instanceof CommandListenerWrapper) {
+ listener = ((ProxyListener) listener).base; // Search deeper + listener = ((CommandListenerWrapper) listener).base; // Search deeper
+ } else if (VanillaCommandWrapper.lastSender != null) { + } else if (VanillaCommandWrapper.lastSender != null) {
+ sender = VanillaCommandWrapper.lastSender; + sender = VanillaCommandWrapper.lastSender;
+ } else if (listener.f() != null) { + } else if (listener.f() != null) {
@ -52,7 +41,7 @@
+ throw new CommandException("Unhandled executor " + icommandlistener.getClass().getSimpleName(), new Object[0]); + throw new CommandException("Unhandled executor " + icommandlistener.getClass().getSimpleName(), new Object[0]);
+ } + }
+ } + }
+ int i = CommandBlockListenerAbstract.executeCommand(icommandlistener1, new ProxiedNativeCommandSender(icommandlistener1, sender, entity.getBukkitEntity()), s); + int i = CommandBlockListenerAbstract.executeCommand(commandlistenerwrapper, new ProxiedNativeCommandSender(commandlistenerwrapper, sender, entity.getBukkitEntity()), s);
+ // CraftBukkit end + // CraftBukkit end
if (i < 1) { if (i < 1) {

Datei anzeigen

@ -23,8 +23,8 @@
public ContainerBrewingStand(PlayerInventory playerinventory, IInventory iinventory) { public ContainerBrewingStand(PlayerInventory playerinventory, IInventory iinventory) {
+ player = playerinventory; // CraftBukkit + player = playerinventory; // CraftBukkit
this.brewingStand = iinventory; this.brewingStand = iinventory;
this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(playerinventory.player, iinventory, 0, 56, 51))); this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(iinventory, 0, 56, 51)));
this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(playerinventory.player, iinventory, 1, 79, 58))); this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(iinventory, 1, 79, 58)));
@@ -54,6 +65,7 @@ @@ -54,6 +65,7 @@
} }
@ -33,7 +33,7 @@
return this.brewingStand.a(entityhuman); return this.brewingStand.a(entityhuman);
} }
@@ -181,4 +193,17 @@ @@ -178,4 +190,17 @@
return item == Items.POTION || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE; return item == Items.POTION || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
} }
} }

Datei anzeigen

@ -147,11 +147,11 @@
+ } + }
- if (flag) { - if (flag) {
- Items.ENCHANTED_BOOK.a(itemstack, weightedrandomenchant); - ItemEnchantedBook.a(itemstack, weightedrandomenchant);
- } else { - } else {
- itemstack.addEnchantment(weightedrandomenchant.enchantment, weightedrandomenchant.level); - itemstack.addEnchantment(weightedrandomenchant.enchantment, weightedrandomenchant.level);
+ WeightedRandomEnchant weightedrandomenchant = new WeightedRandomEnchant(Enchantment.c(enchantId), entry.getValue()); + WeightedRandomEnchant weightedrandomenchant = new WeightedRandomEnchant(Enchantment.c(enchantId), entry.getValue());
+ Items.ENCHANTED_BOOK.a(itemstack, weightedrandomenchant); + ItemEnchantedBook.a(itemstack, weightedrandomenchant);
+ } else { + } else {
+ item.addUnsafeEnchantment(entry.getKey(), entry.getValue()); + item.addUnsafeEnchantment(entry.getKey(), entry.getValue());
+ } + }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CustomFunctionData.java --- a/net/minecraft/server/CustomFunctionData.java
+++ b/net/minecraft/server/CustomFunctionData.java +++ b/net/minecraft/server/CustomFunctionData.java
@@ -31,7 +31,7 @@ @@ -33,7 +33,7 @@
} }
public World getWorld() { public World getWorld() {
@ -9,7 +9,7 @@
} }
public MinecraftServer C_() { public MinecraftServer C_() {
@@ -55,7 +55,7 @@ @@ -57,7 +57,7 @@
} }
public int c() { public int c() {
@ -18,7 +18,7 @@
} }
public Map<MinecraftKey, CustomFunction> d() { public Map<MinecraftKey, CustomFunction> d() {
@@ -63,7 +63,7 @@ @@ -65,7 +65,7 @@
} }
public void e() { public void e() {

Datei anzeigen

@ -98,7 +98,7 @@
+ +
thread.setDaemon(true); thread.setDaemon(true);
thread.start(); thread.start();
DedicatedServer.LOGGER.info("Starting minecraft server version 1.12-pre2"); DedicatedServer.LOGGER.info("Starting minecraft server version 1.12-pre5");
@@ -79,7 +126,7 @@ @@ -79,7 +126,7 @@
} }
@ -172,14 +172,14 @@
while (!this.serverCommandQueue.isEmpty()) { while (!this.serverCommandQueue.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
- this.getCommandHandler().b(servercommand.source, servercommand.command); - this.getCommandHandler().a(servercommand.source, servercommand.command);
+ // CraftBukkit start - ServerCommand for preprocessing + // CraftBukkit start - ServerCommand for preprocessing
+ ServerCommandEvent event = new ServerCommandEvent(console, servercommand.command); + ServerCommandEvent event = new ServerCommandEvent(console, servercommand.command);
+ server.getPluginManager().callEvent(event); + server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) continue; + if (event.isCancelled()) continue;
+ servercommand = new ServerCommand(event.getCommand(), servercommand.source); + servercommand = new ServerCommand(event.getCommand(), servercommand.source);
+ +
+ // this.getCommandHandler().b(servercommand.source, servercommand.command); // Called in dispatchServerCommand + // this.getCommandHandler().a(servercommand.source, servercommand.command); // Called in dispatchServerCommand
+ server.dispatchServerCommand(console, servercommand); + server.dispatchServerCommand(console, servercommand);
+ // CraftBukkit end + // CraftBukkit end
} }
@ -215,7 +215,7 @@
- public String executeRemoteCommand(String s) { - public String executeRemoteCommand(String s) {
- this.remoteControlCommandListener.clearMessages(); - this.remoteControlCommandListener.clearMessages();
- this.b.b(this.remoteControlCommandListener, s); - this.b.a(this.remoteControlCommandListener, s);
- return this.remoteControlCommandListener.getMessages(); - return this.remoteControlCommandListener.getMessages();
+ return result.toString(); + return result.toString();
+ // CraftBukkit end + // CraftBukkit end

Datei anzeigen

@ -16,7 +16,7 @@
public class DispenserRegistry { public class DispenserRegistry {
public static final PrintStream a = System.out; public static final PrintStream a = System.out;
@@ -70,7 +79,7 @@ @@ -71,7 +80,7 @@
BlockDispenser.REGISTRY.a(Items.SPLASH_POTION, new IDispenseBehavior() { BlockDispenser.REGISTRY.a(Items.SPLASH_POTION, new IDispenseBehavior() {
public ItemStack a(ISourceBlock isourceblock, final ItemStack itemstack) { public ItemStack a(ISourceBlock isourceblock, final ItemStack itemstack) {
return (new DispenseBehaviorProjectile() { return (new DispenseBehaviorProjectile() {
@ -25,7 +25,7 @@
return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), itemstack1.cloneItemStack()); return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), itemstack1.cloneItemStack());
} }
@@ -87,7 +96,7 @@ @@ -88,7 +97,7 @@
BlockDispenser.REGISTRY.a(Items.LINGERING_POTION, new IDispenseBehavior() { BlockDispenser.REGISTRY.a(Items.LINGERING_POTION, new IDispenseBehavior() {
public ItemStack a(ISourceBlock isourceblock, final ItemStack itemstack) { public ItemStack a(ISourceBlock isourceblock, final ItemStack itemstack) {
return (new DispenseBehaviorProjectile() { return (new DispenseBehaviorProjectile() {
@ -34,7 +34,7 @@
return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), itemstack1.cloneItemStack()); return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), itemstack1.cloneItemStack());
} }
@@ -107,14 +116,46 @@ @@ -108,14 +117,46 @@
double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX(); double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX();
double d1 = (double) ((float) (isourceblock.getBlockPosition().getY() + enumdirection.getAdjacentY()) + 0.2F); double d1 = (double) ((float) (isourceblock.getBlockPosition().getY() + enumdirection.getAdjacentY()) + 0.2F);
double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ(); double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ();
@ -83,7 +83,7 @@
return itemstack; return itemstack;
} }
}); });
@@ -124,10 +165,39 @@ @@ -125,10 +166,39 @@
double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX(); double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX();
double d1 = (double) ((float) isourceblock.getBlockPosition().getY() + 0.2F); double d1 = (double) ((float) isourceblock.getBlockPosition().getY() + 0.2F);
double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ(); double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ();
@ -125,7 +125,7 @@
return itemstack; return itemstack;
} }
@@ -148,8 +218,38 @@ @@ -149,8 +219,38 @@
double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentY(); double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentY();
double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentZ(); double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentZ();
@ -166,7 +166,7 @@
return itemstack; return itemstack;
} }
@@ -170,7 +270,53 @@ @@ -171,7 +271,53 @@
ItemBucket itembucket = (ItemBucket) itemstack.getItem(); ItemBucket itembucket = (ItemBucket) itemstack.getItem();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@ -221,7 +221,7 @@
} }
}; };
@@ -197,6 +343,30 @@ @@ -198,6 +344,30 @@
item = Items.LAVA_BUCKET; item = Items.LAVA_BUCKET;
} }
@ -252,7 +252,7 @@
world.setAir(blockposition); world.setAir(blockposition);
itemstack.subtract(1); itemstack.subtract(1);
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
@@ -214,14 +384,42 @@ @@ -215,14 +385,42 @@
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
@ -298,7 +298,7 @@
} else if (world.getType(blockposition).getBlock() == Blocks.TNT) { } else if (world.getType(blockposition).getBlock() == Blocks.TNT) {
Blocks.TNT.postBreak(world, blockposition, Blocks.TNT.getBlockData().set(BlockTNT.EXPLODE, Boolean.valueOf(true))); Blocks.TNT.postBreak(world, blockposition, Blocks.TNT.getBlockData().set(BlockTNT.EXPLODE, Boolean.valueOf(true)));
world.setAir(blockposition); world.setAir(blockposition);
@@ -239,6 +437,32 @@ @@ -240,6 +438,32 @@
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@ -331,7 +331,7 @@
if (ItemDye.a(itemstack, world, blockposition)) { if (ItemDye.a(itemstack, world, blockposition)) {
if (!world.isClientSide) { if (!world.isClientSide) {
world.triggerEffect(2005, blockposition, 0); world.triggerEffect(2005, blockposition, 0);
@@ -246,6 +470,26 @@ @@ -247,6 +471,26 @@
} else { } else {
this.b = false; this.b = false;
} }
@ -358,7 +358,7 @@
return itemstack; return itemstack;
} else { } else {
@@ -257,11 +501,40 @@ @@ -258,11 +502,40 @@
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@ -401,7 +401,7 @@
return itemstack; return itemstack;
} }
}); });
@@ -272,6 +545,30 @@ @@ -273,6 +546,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
BlockSkull blockskull = Blocks.SKULL; BlockSkull blockskull = Blocks.SKULL;
@ -432,7 +432,7 @@
this.b = true; this.b = true;
if (world.isEmpty(blockposition) && blockskull.b(world, blockposition, itemstack)) { if (world.isEmpty(blockposition) && blockskull.b(world, blockposition, itemstack)) {
if (!world.isClientSide) { if (!world.isClientSide) {
@@ -320,6 +617,30 @@ @@ -321,6 +618,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
BlockPumpkin blockpumpkin = (BlockPumpkin) Blocks.PUMPKIN; BlockPumpkin blockpumpkin = (BlockPumpkin) Blocks.PUMPKIN;
@ -463,7 +463,7 @@
this.b = true; this.b = true;
if (world.isEmpty(blockposition) && blockpumpkin.b(world, blockposition)) { if (world.isEmpty(blockposition) && blockpumpkin.b(world, blockposition)) {
if (!world.isClientSide) { if (!world.isClientSide) {
@@ -403,6 +724,30 @@ @@ -407,6 +728,30 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
@ -494,7 +494,7 @@
this.b = world.a(block, blockposition, false, EnumDirection.DOWN, (Entity) null); this.b = world.a(block, blockposition, false, EnumDirection.DOWN, (Entity) null);
if (this.b) { if (this.b) {
EnumDirection enumdirection1 = world.isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP; EnumDirection enumdirection1 = world.isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP;
@@ -471,12 +816,40 @@ @@ -475,12 +820,40 @@
d3 = 0.0D; d3 = 0.0D;
} }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Enchantment.java --- a/net/minecraft/server/Enchantment.java
+++ b/net/minecraft/server/Enchantment.java +++ b/net/minecraft/server/Enchantment.java
@@ -19,7 +19,7 @@ @@ -20,7 +20,7 @@
} }
public static int getId(Enchantment enchantment) { public static int getId(Enchantment enchantment) {
@ -9,7 +9,7 @@
} }
@Nullable @Nullable
@@ -154,6 +154,11 @@ @@ -155,6 +155,11 @@
Enchantment.enchantments.a(62, new MinecraftKey("lure"), new EnchantmentLure(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())); Enchantment.enchantments.a(70, new MinecraftKey("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
Enchantment.enchantments.a(71, new MinecraftKey("vanishing_curse"), new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values())); Enchantment.enchantments.a(71, new MinecraftKey("vanishing_curse"), new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values()));

Datei anzeigen

@ -33,7 +33,7 @@
protected int bA; protected int bA;
public float bB; public float bB;
public float bC; public float bC;
@@ -53,6 +66,17 @@ @@ -52,6 +65,17 @@
@Nullable @Nullable
public EntityFishingHook hookedFish; public EntityFishingHook hookedFish;
@ -51,7 +51,7 @@
protected ItemCooldown l() { protected ItemCooldown l() {
return new ItemCooldown(); return new ItemCooldown();
} }
@@ -311,7 +335,8 @@ @@ -310,7 +334,8 @@
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean("naturalRegeneration")) { if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean("naturalRegeneration")) {
if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) { if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) {
@ -61,7 +61,7 @@
} }
if (this.foodData.c() && this.ticksLived % 10 == 0) { if (this.foodData.c() && this.ticksLived % 10 == 0) {
@@ -335,7 +360,7 @@ @@ -334,7 +359,7 @@
this.m((float) attributeinstance.getValue()); this.m((float) attributeinstance.getValue());
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
@ -70,7 +70,7 @@
if (f > 0.1F) { if (f > 0.1F) {
f = 0.1F; f = 0.1F;
@@ -457,6 +482,7 @@ @@ -456,6 +481,7 @@
@Nullable @Nullable
public EntityItem a(boolean flag) { public EntityItem a(boolean flag) {
@ -78,7 +78,7 @@
return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && !this.inventory.getItemInHand().isEmpty() ? this.inventory.getItemInHand().getCount() : 1), false, true); return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && !this.inventory.getItemInHand().isEmpty() ? this.inventory.getItemInHand().getCount() : 1), false, true);
} }
@@ -499,6 +525,30 @@ @@ -498,6 +524,30 @@
entityitem.motZ += Math.sin((double) f1) * (double) f; entityitem.motZ += Math.sin((double) f1) * (double) f;
} }
@ -109,7 +109,7 @@
ItemStack itemstack1 = this.a(entityitem); ItemStack itemstack1 = this.a(entityitem);
if (flag1) { if (flag1) {
@@ -614,6 +664,13 @@ @@ -613,6 +663,13 @@
this.a(true, true, false); this.a(true, true, false);
} }
@ -123,7 +123,7 @@
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) { if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
this.d = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ")); this.d = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
this.e = nbttagcompound.getBoolean("SpawnForced"); this.e = nbttagcompound.getBoolean("SpawnForced");
@@ -666,6 +723,7 @@ @@ -665,6 +722,7 @@
if (!this.getShoulderEntityRight().isEmpty()) { if (!this.getShoulderEntityRight().isEmpty()) {
nbttagcompound.set("ShoulderEntityRight", this.getShoulderEntityRight()); nbttagcompound.set("ShoulderEntityRight", this.getShoulderEntityRight());
} }
@ -131,7 +131,7 @@
} }
@@ -686,7 +744,7 @@ @@ -685,7 +743,7 @@
this.releaseShoulderEntities(); this.releaseShoulderEntities();
if (damagesource.r()) { if (damagesource.r()) {
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL) { if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL) {
@ -140,7 +140,7 @@
} }
if (this.world.getDifficulty() == EnumDifficulty.EASY) { if (this.world.getDifficulty() == EnumDifficulty.EASY) {
@@ -698,7 +756,7 @@ @@ -697,7 +755,7 @@
} }
} }
@ -149,7 +149,7 @@
} }
} }
} }
@@ -712,10 +770,29 @@ @@ -711,10 +769,29 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
@ -182,7 +182,7 @@
} }
protected void damageArmor(float f) { protected void damageArmor(float f) {
@@ -758,7 +835,12 @@ @@ -757,7 +834,12 @@
return (float) i / (float) this.inventory.armor.size(); return (float) i / (float) this.inventory.armor.size();
} }
@ -196,7 +196,7 @@
if (!this.isInvulnerable(damagesource)) { if (!this.isInvulnerable(damagesource)) {
f = this.applyArmorModifier(damagesource, f); f = this.applyArmorModifier(damagesource, f);
f = this.applyMagicModifier(damagesource, f); f = this.applyMagicModifier(damagesource, f);
@@ -778,6 +860,7 @@ @@ -777,6 +859,7 @@
} }
} }
@ -204,7 +204,7 @@
} }
public void openSign(TileEntitySign tileentitysign) {} public void openSign(TileEntitySign tileentitysign) {}
@@ -899,8 +982,15 @@ @@ -898,8 +981,15 @@
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth(); f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isBurning()) { if (j > 0 && !entity.isBurning()) {
@ -222,7 +222,7 @@
} }
} }
@@ -931,8 +1021,11 @@ @@ -930,8 +1020,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next(); EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.r(entityliving) && this.h(entityliving) < 9.0D) { if (entityliving != this && entityliving != entity && !this.r(entityliving) && this.h(entityliving) < 9.0D) {
@ -235,7 +235,7 @@
} }
} }
@@ -941,11 +1034,28 @@ @@ -940,11 +1033,28 @@
} }
if (entity instanceof EntityPlayer && entity.velocityChanged) { if (entity instanceof EntityPlayer && entity.velocityChanged) {
@ -264,7 +264,7 @@
} }
if (flag2) { if (flag2) {
@@ -994,7 +1104,14 @@ @@ -993,7 +1103,14 @@
this.a(StatisticList.y, Math.round(f5 * 10.0F)); this.a(StatisticList.y, Math.round(f5 * 10.0F));
if (j > 0) { if (j > 0) {
@ -280,7 +280,7 @@
} }
if (this.world instanceof WorldServer && f5 > 2.0F) { if (this.world instanceof WorldServer && f5 > 2.0F) {
@@ -1010,6 +1127,11 @@ @@ -1009,6 +1126,11 @@
if (flag4) { if (flag4) {
entity.extinguish(); entity.extinguish();
} }
@ -292,7 +292,7 @@
} }
} }
@@ -1100,6 +1222,20 @@ @@ -1099,6 +1221,20 @@
this.stopRiding(); this.stopRiding();
} }
@ -313,7 +313,7 @@
this.releaseShoulderEntities(); this.releaseShoulderEntities();
this.setSize(0.2F, 0.2F); this.setSize(0.2F, 0.2F);
if (this.world.isLoaded(blockposition)) { if (this.world.isLoaded(blockposition)) {
@@ -1160,6 +1296,23 @@ @@ -1159,6 +1295,23 @@
this.world.everyoneSleeping(); this.world.everyoneSleeping();
} }
@ -337,7 +337,7 @@
this.sleepTicks = flag ? 0 : 100; this.sleepTicks = flag ? 0 : 100;
if (flag2) { if (flag2) {
this.setRespawnPosition(this.bedPosition, false); this.setRespawnPosition(this.bedPosition, false);
@@ -1211,9 +1364,11 @@ @@ -1210,9 +1363,11 @@
if (blockposition != null) { if (blockposition != null) {
this.d = blockposition; this.d = blockposition;
this.e = flag; this.e = flag;
@ -349,7 +349,7 @@
} }
} }
@@ -1537,13 +1692,17 @@ @@ -1540,13 +1695,17 @@
} }
protected void releaseShoulderEntities() { protected void releaseShoulderEntities() {
@ -372,7 +372,7 @@
if (!this.world.isClientSide && !nbttagcompound.isEmpty()) { if (!this.world.isClientSide && !nbttagcompound.isEmpty()) {
Entity entity = EntityTypes.a(nbttagcompound, this.world); Entity entity = EntityTypes.a(nbttagcompound, this.world);
@@ -1552,9 +1711,10 @@ @@ -1555,9 +1714,10 @@
} }
entity.setPosition(this.locX, this.locY + 0.699999988079071D, this.locZ); entity.setPosition(this.locX, this.locY + 0.699999988079071D, this.locZ);
@ -384,7 +384,7 @@
} }
public abstract boolean isSpectator(); public abstract boolean isSpectator();
@@ -1756,7 +1916,7 @@ @@ -1759,7 +1919,7 @@
return entitymonster.c(this.a); return entitymonster.c(this.a);
} }

Datei anzeigen

@ -37,7 +37,7 @@
+ +
entitypigzombie.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD)); entitypigzombie.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
entitypigzombie.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch); entitypigzombie.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
entitypigzombie.setAI(this.hasAI()); entitypigzombie.setNoAI(this.isNoAI());
@@ -163,7 +172,8 @@ @@ -163,7 +172,8 @@
entitypigzombie.setCustomNameVisible(this.getCustomNameVisible()); entitypigzombie.setCustomNameVisible(this.getCustomNameVisible());
} }

Datei anzeigen

@ -22,7 +22,7 @@
+ +
public class EntityPlayer extends EntityHuman implements ICrafting { public class EntityPlayer extends EntityHuman implements ICrafting {
private static final Logger bW = LogManager.getLogger(); private static final Logger bV = LogManager.getLogger();
@@ -51,6 +67,19 @@ @@ -51,6 +67,19 @@
public int ping; public int ping;
public boolean viewingCredits; public boolean viewingCredits;
@ -43,15 +43,7 @@
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
super(worldserver, gameprofile); super(worldserver, gameprofile);
playerinteractmanager.player = this; playerinteractmanager.player = this;
@@ -75,13 +104,18 @@ @@ -82,6 +111,11 @@
this.server = minecraftserver;
this.ca = minecraftserver.getPlayerList().a((EntityHuman) this);
this.bZ = minecraftserver.getPlayerList().h(this);
- this.P = 0.0F;
+ this.P = 1.0F; // CraftBukkit - hit when sneaking
this.setPositionRotation(blockposition, 0.0F, 0.0F);
while (!worldserver.getCubes(this, this.getBoundingBox()).isEmpty() && this.locY < 255.0D) {
this.setPosition(this.locX, this.locY + 1.0D, this.locZ); this.setPosition(this.locX, this.locY + 1.0D, this.locZ);
} }
@ -65,7 +57,7 @@
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
@@ -104,6 +138,7 @@ @@ -104,6 +138,7 @@
if (nbttagcompound.hasKeyOfType("recipeBook", 10)) { if (nbttagcompound.hasKeyOfType("recipeBook", 10)) {
this.cs.a(nbttagcompound.getCompound("recipeBook")); this.cr.a(nbttagcompound.getCompound("recipeBook"));
} }
+ this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit + this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit
@ -74,7 +66,7 @@
@@ -150,8 +185,34 @@ @@ -150,8 +185,34 @@
} }
nbttagcompound.set("recipeBook", this.cs.e()); nbttagcompound.set("recipeBook", this.cr.e());
+ this.getBukkitEntity().setExtraData(nbttagcompound); // CraftBukkit + this.getBukkitEntity().setExtraData(nbttagcompound); // CraftBukkit
} }
@ -121,14 +113,14 @@
@@ -250,7 +316,7 @@ @@ -250,7 +316,7 @@
} }
if (this.getHealth() != this.lastHealthSent || this.ci != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.cj) { if (this.getHealth() != this.lastHealthSent || this.ch != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.ci) {
- this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); - this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel()));
+ this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getBukkitEntity().getScaledHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); // CraftBukkit + this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getBukkitEntity().getScaledHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); // CraftBukkit
this.lastHealthSent = this.getHealth(); this.lastHealthSent = this.getHealth();
this.ci = this.foodData.getFoodLevel(); this.ch = this.foodData.getFoodLevel();
this.cj = this.foodData.getSaturationLevel() == 0.0F; this.ci = this.foodData.getSaturationLevel() == 0.0F;
@@ -271,6 +337,12 @@ @@ -271,6 +337,12 @@
this.a(IScoreboardCriteria.i, MathHelper.f((float) this.cd)); this.a(IScoreboardCriteria.i, MathHelper.f((float) this.cc));
} }
+ // CraftBukkit start - Force max health updates + // CraftBukkit start - Force max health updates
@ -137,9 +129,9 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
if (this.getArmorStrength() != this.ce) { if (this.getArmorStrength() != this.cd) {
this.ce = this.getArmorStrength(); this.cd = this.getArmorStrength();
this.a(IScoreboardCriteria.j, MathHelper.f((float) this.ce)); this.a(IScoreboardCriteria.j, MathHelper.f((float) this.cd));
@@ -295,6 +367,16 @@ @@ -295,6 +367,16 @@
CriterionTriggers.o.a(this); CriterionTriggers.o.a(this);
} }
@ -319,7 +311,7 @@
+ if (this.isSleeping()) return this; // CraftBukkit - SPIGOT-3154 + if (this.isSleeping()) return this; // CraftBukkit - SPIGOT-3154
+ // this.worldChangeInvuln = true; // CraftBukkit - Moved down and into PlayerList#changeDimension + // this.worldChangeInvuln = true; // CraftBukkit - Moved down and into PlayerList#changeDimension
if (this.dimension == 0 && i == -1) { if (this.dimension == 0 && i == -1) {
this.cw = new Vec3D(this.locX, this.locY, this.locZ); this.cv = new Vec3D(this.locX, this.locY, this.locZ);
} else if (this.dimension != -1 && i != 0) { } else if (this.dimension != -1 && i != 0) {
@@ -476,6 +599,7 @@ @@ -476,6 +599,7 @@
} }
@ -519,12 +511,12 @@
@@ -880,7 +1071,7 @@ @@ -880,7 +1071,7 @@
this.lastSentExp = -1; this.lastSentExp = -1;
this.lastHealthSent = -1.0F; this.lastHealthSent = -1.0F;
this.ci = -1; this.ch = -1;
- this.cs.a((RecipeBook) entityplayer.cs); - this.cr.a((RecipeBook) entityplayer.cr);
+ // this.cs.a((RecipeBook) entityplayer.cs); // CraftBukkit + // this.cr.a((RecipeBook) entityplayer.cr); // CraftBukkit
this.removeQueue.addAll(entityplayer.removeQueue); this.removeQueue.addAll(entityplayer.removeQueue);
this.cr = entityplayer.cr; this.cq = entityplayer.cq;
this.cw = entityplayer.cw; this.cv = entityplayer.cv;
@@ -939,6 +1130,18 @@ @@ -939,6 +1130,18 @@
} }
@ -579,14 +571,14 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.locale = packetplayinsettings.a(); this.locale = packetplayinsettings.a();
this.cm = packetplayinsettings.c(); this.cl = packetplayinsettings.c();
this.cn = packetplayinsettings.d(); this.cm = packetplayinsettings.d();
@@ -1054,7 +1273,7 @@ @@ -1054,7 +1273,7 @@
this.cp = (Entity) (entity == null ? this : entity); this.co = (Entity) (entity == null ? this : entity);
if (entity1 != this.cp) { if (entity1 != this.co) {
this.playerConnection.sendPacket(new PacketPlayOutCamera(this.cp)); this.playerConnection.sendPacket(new PacketPlayOutCamera(this.co));
- this.enderTeleportTo(this.cp.locX, this.cp.locY, this.cp.locZ); - this.enderTeleportTo(this.co.locX, this.co.locY, this.co.locZ);
+ this.playerConnection.a(this.cp.locX, this.cp.locY, this.cp.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit + this.playerConnection.a(this.co.locX, this.co.locY, this.co.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
} }
} }
@ -619,7 +611,7 @@
public AdvancementDataPlayer getAdvancementData() { public AdvancementDataPlayer getAdvancementData() {
@@ -1114,4 +1338,139 @@ @@ -1114,4 +1338,139 @@
public Vec3D Q() { public Vec3D Q() {
return this.cw; return this.cv;
} }
+ +
+ // CraftBukkit start - Add per-player time and weather. + // CraftBukkit start - Add per-player time and weather.

Datei anzeigen

@ -31,7 +31,7 @@
} }
} }
@@ -167,8 +181,8 @@ @@ -167,8 +181,8 @@
if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).r() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) { if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
entityzombie.setPosition((double) i1, (double) j1, (double) k1); entityzombie.setPosition((double) i1, (double) j1, (double) k1);
if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
- this.world.addEntity(entityzombie); - this.world.addEntity(entityzombie);

Datei anzeigen

@ -57,8 +57,8 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
if (packethandshakinginsetprotocol.b() > 329) { if (packethandshakinginsetprotocol.b() > 332) {
chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.12-pre2"); chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.12-pre5");
this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext)); this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
@@ -26,6 +71,7 @@ @@ -26,6 +71,7 @@
this.b.close(chatcomponenttext); this.b.close(chatcomponenttext);

Datei anzeigen

@ -12,8 +12,8 @@
} }
public int a(IRecipe irecipe) { public int a(IRecipe irecipe) {
- return ((MinecraftKey) CraftingManager.recipes.b(this)).a((MinecraftKey) CraftingManager.recipes.b(irecipe)); - return ((MinecraftKey) CraftingManager.recipes.b(this)).toString().compareTo(((MinecraftKey) CraftingManager.recipes.b(irecipe)).toString());
+ return this.key.a(irecipe.key); // CraftBukkit + return this.key.toString().compareTo(irecipe.key.toString()); // CraftBukkit
} }
- public int compareTo(Object object) { - public int compareTo(Object object) {

Datei anzeigen

@ -52,7 +52,7 @@
- } else if (this.a(entityhuman, world, blockposition1)) { - } else if (this.a(entityhuman, world, blockposition1)) {
+ } else if (this.a(entityhuman, world, blockposition1, movingobjectposition.direction, blockposition, itemstack)) { // CraftBukkit + } else if (this.a(entityhuman, world, blockposition1, movingobjectposition.direction, blockposition, itemstack)) { // CraftBukkit
if (entityhuman instanceof EntityPlayer) { if (entityhuman instanceof EntityPlayer) {
CriterionTriggers.x.a((EntityPlayer) entityhuman, blockposition, itemstack); CriterionTriggers.x.a((EntityPlayer) entityhuman, blockposition1, itemstack);
} }
@@ -67,16 +87,19 @@ @@ -67,16 +87,19 @@
} }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ItemSkull.java --- a/net/minecraft/server/ItemSkull.java
+++ b/net/minecraft/server/ItemSkull.java +++ b/net/minecraft/server/ItemSkull.java
@@ -120,6 +120,15 @@ @@ -124,6 +124,15 @@
nbttagcompound.set("SkullOwner", GameProfileSerializer.serialize(new NBTTagCompound(), gameprofile)); nbttagcompound.set("SkullOwner", GameProfileSerializer.serialize(new NBTTagCompound(), gameprofile));
return true; return true;
} else { } else {

Datei anzeigen

@ -303,7 +303,7 @@
itemstack.d(this.D()); itemstack.d(this.D());
if (this.tag != null) { if (this.tag != null) {
@@ -514,6 +720,12 @@ @@ -513,6 +719,12 @@
nbttaglist.add(nbttagcompound); nbttaglist.add(nbttagcompound);
} }

Datei anzeigen

@ -13,6 +13,6 @@
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); + return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (!entityhuman.abilities.canInstantlyBuild) { if (entityhuman instanceof EntityPlayer) {
itemstack.subtract(1); CriterionTriggers.x.a((EntityPlayer) entityhuman, blockposition1, itemstack);
} }

Datei anzeigen

@ -71,7 +71,7 @@
int i = 1 << worldmap.scale; int i = 1 << worldmap.scale;
int j = worldmap.centerX; int j = worldmap.centerX;
int k = worldmap.centerZ; int k = worldmap.centerZ;
@@ -308,6 +322,7 @@ @@ -309,6 +323,7 @@
protected static void a(ItemStack itemstack, World world, int i) { protected static void a(ItemStack itemstack, World world, int i) {
WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, world); WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, world);
@ -79,7 +79,7 @@
itemstack.setData(world.b("map")); itemstack.setData(world.b("map"));
WorldMap worldmap1 = new WorldMap("map_" + itemstack.getData()); WorldMap worldmap1 = new WorldMap("map_" + itemstack.getData());
@@ -318,6 +333,10 @@ @@ -319,6 +334,10 @@
worldmap1.map = worldmap.map; worldmap1.map = worldmap.map;
worldmap1.c(); worldmap1.c();
world.a("map_" + itemstack.getData(), (PersistentBase) worldmap1); world.a("map_" + itemstack.getData(), (PersistentBase) worldmap1);
@ -90,7 +90,7 @@
} }
} }
@@ -325,6 +344,7 @@ @@ -326,6 +345,7 @@
protected static void b(ItemStack itemstack, World world) { protected static void b(ItemStack itemstack, World world) {
WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, world); WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, world);
@ -98,7 +98,7 @@
itemstack.setData(world.b("map")); itemstack.setData(world.b("map"));
WorldMap worldmap1 = new WorldMap("map_" + itemstack.getData()); WorldMap worldmap1 = new WorldMap("map_" + itemstack.getData());
@@ -336,6 +356,10 @@ @@ -337,6 +357,10 @@
worldmap1.map = worldmap.map; worldmap1.map = worldmap.map;
worldmap1.c(); worldmap1.c();
world.a("map_" + itemstack.getData(), (PersistentBase) worldmap1); world.a("map_" + itemstack.getData(), (PersistentBase) worldmap1);

Datei anzeigen

@ -22,16 +22,16 @@
public boolean isEmpty() { public boolean isEmpty() {
return this.d.size() < 1; return this.d.size() < 1;
} }
@@ -177,7 +183,7 @@ @@ -178,7 +184,7 @@
JsonListEntry jsonlistentry = (JsonListEntry) iterator.next(); JsonListEntry jsonlistentry = (JsonListEntry) iterator.next();
if (jsonlistentry.getKey() != null) { if (jsonlistentry.getKey() != null) {
- this.d.put(this.a(jsonlistentry.getKey()), jsonlistentry); - this.d.put(this.a(jsonlistentry.getKey()), jsonlistentry);
+ this.d.put(this.a((K) jsonlistentry.getKey()), (V) jsonlistentry); // CraftBukkit - fix decompile error + this.d.put(this.a((K) jsonlistentry.getKey()), (V) jsonlistentry); // CraftBukkit - fix decompile error
}
} }
} }
} @@ -207,11 +213,11 @@
@@ -205,11 +211,11 @@
} }
} }

Datei anzeigen

@ -1,11 +0,0 @@
--- a/net/minecraft/server/MapIcon.java
+++ b/net/minecraft/server/MapIcon.java
@@ -86,7 +86,7 @@
}
public static MapIcon.Type a(byte b0) {
- return values()[b0];
+ return b0 >= 0 && b0 < values().length ? values()[b0] : MapIcon.Type.PLAYER; // CraftBukkit
}
}
}

Datei anzeigen

@ -12,7 +12,7 @@
public class PathfinderGoalFollowOwner extends PathfinderGoal { public class PathfinderGoalFollowOwner extends PathfinderGoal {
private final EntityTameableAnimal d; private final EntityTameableAnimal d;
@@ -79,7 +85,18 @@ @@ -73,7 +79,18 @@
for (int l = 0; l <= 4; ++l) { for (int l = 0; l <= 4; ++l) {
for (int i1 = 0; i1 <= 4; ++i1) { for (int i1 = 0; i1 <= 4; ++i1) {
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.a(i, j, k, l, i1)) { if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.a(i, j, k, l, i1)) {

Datei anzeigen

@ -3,7 +3,7 @@
@@ -40,7 +40,11 @@ @@ -40,7 +40,11 @@
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
if (this.f == 0 && block instanceof BlockCrops && ((BlockCrops) block).A(iblockdata)) { if (this.f == 0 && block instanceof BlockCrops && ((BlockCrops) block).z(iblockdata)) {
- world.setAir(blockposition, true); - world.setAir(blockposition, true);
+ // CraftBukkit start + // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.c, blockposition, Blocks.AIR, 0).isCancelled()) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.c, blockposition, Blocks.AIR, 0).isCancelled()) {

Datei anzeigen

@ -170,15 +170,6 @@
} }
public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) { public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) {
@@ -158,7 +258,7 @@
}
private static boolean b(PacketPlayInFlying packetplayinflying) {
- return Doubles.isFinite(packetplayinflying.a(0.0D)) && Doubles.isFinite(packetplayinflying.b(0.0D)) && Doubles.isFinite(packetplayinflying.c(0.0D)) && Floats.isFinite(packetplayinflying.b(0.0F)) && Floats.isFinite(packetplayinflying.a(0.0F)) ? false : Math.abs(packetplayinflying.a(0.0D)) <= 3.0E7D && Math.abs(packetplayinflying.c(0.0D)) <= 3.0E7D;
+ return !Doubles.isFinite(packetplayinflying.a(0.0D)) || !Doubles.isFinite(packetplayinflying.b(0.0D)) || !Doubles.isFinite(packetplayinflying.c(0.0D)) || !Floats.isFinite(packetplayinflying.b(0.0F)) || !Floats.isFinite(packetplayinflying.a(0.0F)) || Math.abs(packetplayinflying.a(0.0D)) >= 3.0E7D || Math.abs(packetplayinflying.b(0.0D)) >= 3.0E7D || Math.abs(packetplayinflying.c(0.0D)) >= 3.0E7D;
}
private static boolean b(PacketPlayInVehicleMove packetplayinvehiclemove) {
@@ -188,7 +288,34 @@ @@ -188,7 +288,34 @@
double d9 = entity.motX * entity.motX + entity.motY * entity.motY + entity.motZ * entity.motZ; double d9 = entity.motX * entity.motX + entity.motY * entity.motY + entity.motZ * entity.motZ;
double d10 = d6 * d6 + d7 * d7 + d8 * d8; double d10 = d6 * d6 + d7 * d7 + d8 * d8;
@ -278,7 +269,7 @@
this.minecraftServer.getPlayerList().d(this.player); this.minecraftServer.getPlayerList().d(this.player);
this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2); this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2);
this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.c(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.c(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -271,7 +454,7 @@ @@ -284,7 +467,7 @@
} else { } else {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@ -287,7 +278,7 @@
if (this.e == 0) { if (this.e == 0) {
this.syncPosition(); this.syncPosition();
} }
@@ -281,13 +464,21 @@ @@ -294,13 +477,21 @@
this.A = this.e; this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
} }
@ -310,7 +301,7 @@
double d0 = this.player.locX; double d0 = this.player.locX;
double d1 = this.player.locY; double d1 = this.player.locY;
double d2 = this.player.locZ; double d2 = this.player.locZ;
@@ -312,15 +503,33 @@ @@ -325,15 +516,33 @@
++this.receivedMovePackets; ++this.receivedMovePackets;
int i = this.receivedMovePackets - this.processedMovePackets; int i = this.receivedMovePackets - this.processedMovePackets;
@ -346,7 +337,7 @@
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9)); PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9));
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch); this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
return; return;
@@ -366,6 +575,69 @@ @@ -379,6 +588,69 @@
} }
} }
@ -416,7 +407,7 @@
this.B = d12 >= -0.03125D; this.B = d12 >= -0.03125D;
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly; this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cN() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cN() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -383,10 +655,76 @@ @@ -396,10 +668,76 @@
} }
public void a(double d0, double d1, double d2, float f, float f1) { public void a(double d0, double d1, double d2, float f, float f1) {
@ -494,7 +485,7 @@
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D; double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D;
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D; double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D;
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D; double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D;
@@ -403,6 +741,14 @@ @@ -416,6 +754,14 @@
f3 = f1 + this.player.pitch; f3 = f1 + this.player.pitch;
} }
@ -509,7 +500,7 @@
if (++this.teleportAwait == Integer.MAX_VALUE) { if (++this.teleportAwait == Integer.MAX_VALUE) {
this.teleportAwait = 0; this.teleportAwait = 0;
} }
@@ -414,6 +760,7 @@ @@ -427,6 +773,7 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) { public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x());
@ -517,7 +508,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.a(); BlockPosition blockposition = packetplayinblockdig.a();
@@ -423,7 +770,15 @@ @@ -436,7 +783,15 @@
if (!this.player.isSpectator()) { if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND); ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@ -534,7 +525,7 @@
this.player.a(EnumHand.MAIN_HAND, itemstack); this.player.a(EnumHand.MAIN_HAND, itemstack);
} }
@@ -431,6 +786,21 @@ @@ -444,6 +799,21 @@
case DROP_ITEM: case DROP_ITEM:
if (!this.player.isSpectator()) { if (!this.player.isSpectator()) {
@ -556,7 +547,7 @@
this.player.a(false); this.player.a(false);
} }
@@ -464,7 +834,15 @@ @@ -477,7 +847,15 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) { if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b()); this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
} else { } else {
@ -572,7 +563,7 @@
} }
} else { } else {
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) { if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -484,10 +862,12 @@ @@ -497,10 +875,12 @@
default: default:
throw new IllegalArgumentException("Invalid player action"); throw new IllegalArgumentException("Invalid player action");
} }
@ -585,7 +576,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.c(); EnumHand enumhand = packetplayinuseitem.c();
ItemStack itemstack = this.player.b(enumhand); ItemStack itemstack = this.player.b(enumhand);
@@ -501,6 +881,13 @@ @@ -514,6 +894,13 @@
chatmessage.getChatModifier().setColor(EnumChatFormat.RED); chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage, ChatMessageType.GAME_INFO)); this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage, ChatMessageType.GAME_INFO));
} else if (this.teleportPos == null && this.player.d((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) { } else if (this.teleportPos == null && this.player.d((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
@ -599,7 +590,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f()); this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f());
} }
@@ -510,13 +897,52 @@ @@ -523,13 +910,52 @@
public void a(PacketPlayInBlockPlace packetplayinblockplace) { public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x());
@ -653,7 +644,7 @@
} }
} }
@@ -527,8 +953,8 @@ @@ -540,8 +966,8 @@
WorldServer[] aworldserver = this.minecraftServer.worldServer; WorldServer[] aworldserver = this.minecraftServer.worldServer;
int i = aworldserver.length; int i = aworldserver.length;
@ -664,7 +655,7 @@
if (worldserver != null) { if (worldserver != null) {
entity = packetplayinspectate.a(worldserver); entity = packetplayinspectate.a(worldserver);
@@ -541,6 +967,8 @@ @@ -554,6 +980,8 @@
if (entity != null) { if (entity != null) {
this.player.setSpectatorTarget(this.player); this.player.setSpectatorTarget(this.player);
this.player.stopRiding(); this.player.stopRiding();
@ -673,7 +664,7 @@
if (entity.world == this.player.world) { if (entity.world == this.player.world) {
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ); this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
} else { } else {
@@ -566,12 +994,20 @@ @@ -579,12 +1007,20 @@
this.minecraftServer.getPlayerList().b(this.player, worldserver2); this.minecraftServer.getPlayerList().b(this.player, worldserver2);
this.minecraftServer.getPlayerList().updateClient(this.player); this.minecraftServer.getPlayerList().updateClient(this.player);
} }
@ -695,7 +686,7 @@
public void a(PacketPlayInBoatMove packetplayinboatmove) { public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x());
@@ -584,14 +1020,29 @@ @@ -597,14 +1033,29 @@
} }
public void a(IChatBaseComponent ichatbasecomponent) { public void a(IChatBaseComponent ichatbasecomponent) {
@ -727,7 +718,7 @@
if (this.minecraftServer.R() && this.player.getName().equals(this.minecraftServer.Q())) { if (this.minecraftServer.R() && this.player.getName().equals(this.minecraftServer.Q())) {
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out"); PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
this.minecraftServer.safeShutdown(); this.minecraftServer.safeShutdown();
@@ -613,6 +1064,15 @@ @@ -626,6 +1077,15 @@
} }
} }
@ -743,7 +734,7 @@
try { try {
this.networkManager.sendPacket(packet); this.networkManager.sendPacket(packet);
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -634,17 +1094,32 @@ @@ -647,17 +1107,32 @@
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) { public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x());
@ -778,7 +769,7 @@
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]); ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED); chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
@@ -657,39 +1132,249 @@ @@ -670,39 +1145,249 @@
for (int i = 0; i < s.length(); ++i) { for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@ -946,7 +937,7 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
private void handleCommand(String s) { private void handleCommand(String s) {
- this.minecraftServer.getCommandHandler().b(this.player, s); - this.minecraftServer.getCommandHandler().a(this.player, s);
+ // CraftBukkit start - whole method + // CraftBukkit start - whole method
+ this.LOGGER.info(this.player.getName() + " issued server command: " + s); + this.LOGGER.info(this.player.getName() + " issued server command: " + s);
+ +
@ -968,7 +959,7 @@
+ java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ return; + return;
+ } + }
+ // this.minecraftServer.getCommandHandler().b(this.player, s); + // this.minecraftServer.getCommandHandler().a(this.player, s);
+ // CraftBukkit end + // CraftBukkit end
} }
@ -1035,7 +1026,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
IJumpable ijumpable; IJumpable ijumpable;
@@ -761,6 +1446,7 @@ @@ -774,6 +1459,7 @@
public void a(PacketPlayInUseEntity packetplayinuseentity) { public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x());
@ -1043,7 +1034,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver); Entity entity = packetplayinuseentity.a((World) worldserver);
@@ -776,20 +1462,68 @@ @@ -789,20 +1475,68 @@
if (this.player.h(entity) < d0) { if (this.player.h(entity) < d0) {
EnumHand enumhand; EnumHand enumhand;
@ -1113,17 +1104,17 @@
} }
} }
} }
@@ -805,7 +1539,8 @@ @@ -818,7 +1552,8 @@
case PERFORM_RESPAWN: case PERFORM_RESPAWN:
if (this.player.viewingCredits) { if (this.player.viewingCredits) {
this.player.viewingCredits = false; this.player.viewingCredits = false;
- this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true); - this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true);
+ // this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true); + // this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true);
+ this.minecraftServer.getPlayerList().changeDimension(this.player, 0, PlayerTeleportEvent.TeleportCause.END_PORTAL); // CraftBukkit - reroute logic through custom portal management + this.minecraftServer.getPlayerList().changeDimension(this.player, 0, PlayerTeleportEvent.TeleportCause.END_PORTAL); // CraftBukkit - reroute logic through custom portal management
CriterionTriggers.u.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD);
} else { } else {
if (this.player.getHealth() > 0.0F) { if (this.player.getHealth() > 0.0F) {
return; @@ -841,14 +1576,20 @@
@@ -827,14 +1562,20 @@
public void a(PacketPlayInCloseWindow packetplayinclosewindow) { public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
@ -1146,7 +1137,7 @@
NonNullList nonnulllist = NonNullList.a(); NonNullList nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) { for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
@@ -843,8 +1584,274 @@ @@ -857,8 +1598,274 @@
this.player.a(this.player.activeContainer, nonnulllist); this.player.a(this.player.activeContainer, nonnulllist);
} else { } else {
@ -1422,7 +1413,7 @@
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) { if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true)); this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
this.player.f = true; this.player.f = true;
@@ -946,6 +1953,7 @@ @@ -960,6 +1967,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) { public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
@ -1430,7 +1421,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a(this.player, packetplayinenchantitem.b()); this.player.activeContainer.a(this.player, packetplayinenchantitem.b());
@@ -979,7 +1987,46 @@ @@ -993,7 +2001,46 @@
} }
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45; boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
@ -1478,7 +1469,7 @@
if (flag1 && flag2) { if (flag1 && flag2) {
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
@@ -1003,6 +2050,7 @@ @@ -1017,6 +2064,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) { public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
@ -1486,7 +1477,7 @@
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId); Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
@@ -1013,6 +2061,7 @@ @@ -1027,6 +2075,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) { public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
@ -1494,7 +1485,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.a(); BlockPosition blockposition = packetplayinupdatesign.a();
@@ -1029,14 +2078,30 @@ @@ -1043,14 +2092,30 @@
if (!tileentitysign.a() || tileentitysign.e() != this.player) { if (!tileentitysign.a() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign"); this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
@ -1526,7 +1517,7 @@
tileentitysign.update(); tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3); worldserver.notify(blockposition, iblockdata, iblockdata, 3);
@@ -1059,11 +2124,27 @@ @@ -1073,11 +2138,27 @@
public void a(PacketPlayInAbilities packetplayinabilities) { public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
@ -1555,7 +1546,7 @@
ArrayList arraylist = Lists.newArrayList(); ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator(); Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
@@ -1089,6 +2170,13 @@ @@ -1103,6 +2184,13 @@
ItemStack itemstack1; ItemStack itemstack1;
if ("MC|BEdit".equals(s)) { if ("MC|BEdit".equals(s)) {
@ -1569,7 +1560,7 @@
packetdataserializer = packetplayincustompayload.b(); packetdataserializer = packetplayincustompayload.b();
try { try {
@@ -1107,15 +2195,25 @@ @@ -1121,15 +2209,25 @@
} }
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) { if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
@ -1595,7 +1586,7 @@
packetdataserializer = packetplayincustompayload.b(); packetdataserializer = packetplayincustompayload.b();
try { try {
@@ -1149,10 +2247,11 @@ @@ -1163,10 +2261,11 @@
} }
itemstack2.a("pages", (NBTBase) nbttaglist); itemstack2.a("pages", (NBTBase) nbttaglist);
@ -1608,7 +1599,7 @@
} }
} else if ("MC|TrSel".equals(s)) { } else if ("MC|TrSel".equals(s)) {
try { try {
@@ -1164,6 +2263,7 @@ @@ -1178,6 +2277,7 @@
} }
} catch (Exception exception2) { } catch (Exception exception2) {
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2); PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
@ -1616,7 +1607,7 @@
} }
} else { } else {
TileEntity tileentity; TileEntity tileentity;
@@ -1213,6 +2313,7 @@ @@ -1227,6 +2327,7 @@
} }
} catch (Exception exception3) { } catch (Exception exception3) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3); PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
@ -1624,7 +1615,7 @@
} }
} else if ("MC|AutoCmd".equals(s)) { } else if ("MC|AutoCmd".equals(s)) {
if (!this.minecraftServer.getEnableCommandBlock()) { if (!this.minecraftServer.getEnableCommandBlock()) {
@@ -1280,6 +2381,7 @@ @@ -1294,6 +2395,7 @@
} }
} catch (Exception exception4) { } catch (Exception exception4) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4); PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
@ -1632,7 +1623,7 @@
} }
} else { } else {
int k; int k;
@@ -1303,6 +2405,7 @@ @@ -1317,6 +2419,7 @@
} }
} catch (Exception exception5) { } catch (Exception exception5) {
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5); PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
@ -1640,7 +1631,7 @@
} }
} }
} else if ("MC|ItemName".equals(s)) { } else if ("MC|ItemName".equals(s)) {
@@ -1389,6 +2492,7 @@ @@ -1403,6 +2506,7 @@
} }
} catch (Exception exception6) { } catch (Exception exception6) {
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6); PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
@ -1648,7 +1639,7 @@
} }
} else if ("MC|PickItem".equals(s)) { } else if ("MC|PickItem".equals(s)) {
packetdataserializer = packetplayincustompayload.b(); packetdataserializer = packetplayincustompayload.b();
@@ -1401,11 +2505,49 @@ @@ -1415,11 +2519,49 @@
this.player.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex)); this.player.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex));
} catch (Exception exception7) { } catch (Exception exception7) {
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7); PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);

Datei anzeigen

@ -32,7 +32,7 @@
float f; float f;
int i; int i;
@@ -98,6 +106,19 @@ @@ -96,6 +104,19 @@
} }
public void a(BlockPosition blockposition, EnumDirection enumdirection) { public void a(BlockPosition blockposition, EnumDirection enumdirection) {
@ -52,7 +52,7 @@
if (this.isCreative()) { if (this.isCreative()) {
if (!this.world.douseFire((EntityHuman) null, blockposition, enumdirection)) { if (!this.world.douseFire((EntityHuman) null, blockposition, enumdirection)) {
this.breakBlock(blockposition); this.breakBlock(blockposition);
@@ -125,14 +146,48 @@ @@ -123,14 +144,48 @@
} }
} }
@ -103,7 +103,7 @@
if (iblockdata.getMaterial() != Material.AIR && f >= 1.0F) { if (iblockdata.getMaterial() != Material.AIR && f >= 1.0F) {
this.breakBlock(blockposition); this.breakBlock(blockposition);
@@ -150,6 +205,7 @@ @@ -148,6 +203,7 @@
public void a(BlockPosition blockposition) { public void a(BlockPosition blockposition) {
if (blockposition.equals(this.f)) { if (blockposition.equals(this.f)) {
@ -111,7 +111,7 @@
int i = this.currentTick - this.lastDigTick; int i = this.currentTick - this.lastDigTick;
IBlockData iblockdata = this.world.getType(blockposition); IBlockData iblockdata = this.world.getType(blockposition);
@@ -167,6 +223,10 @@ @@ -165,6 +221,10 @@
this.j = this.lastDigTick; this.j = this.lastDigTick;
} }
} }
@ -122,7 +122,7 @@
} }
} }
@@ -190,13 +250,86 @@ @@ -188,13 +248,86 @@
} }
public boolean breakBlock(BlockPosition blockposition) { public boolean breakBlock(BlockPosition blockposition) {
@ -210,7 +210,7 @@
if ((block instanceof BlockCommand || block instanceof BlockStructure) && !this.player.isCreativeAndOp()) { if ((block instanceof BlockCommand || block instanceof BlockStructure) && !this.player.isCreativeAndOp()) {
this.world.notify(blockposition, iblockdata, iblockdata, 3); this.world.notify(blockposition, iblockdata, iblockdata, 3);
return false; return false;
@@ -238,6 +371,12 @@ @@ -236,6 +369,12 @@
} }
} }
@ -223,7 +223,7 @@
return flag; return flag;
} }
} }
@@ -280,63 +419,90 @@ @@ -278,63 +417,90 @@
} }
} }

Datei anzeigen

@ -16,9 +16,9 @@
public class PlayerInventory implements IInventory { public class PlayerInventory implements IInventory {
public final NonNullList<ItemStack> items; public final NonNullList<ItemStack> items;
@@ -16,11 +25,54 @@ @@ -16,6 +25,49 @@
private ItemStack carried; private ItemStack carried;
public boolean f; private int h;
+ // CraftBukkit start - add fields and methods + // CraftBukkit start - add fields and methods
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
@ -26,7 +26,7 @@
+ +
+ public List<ItemStack> getContents() { + public List<ItemStack> getContents() {
+ List<ItemStack> combined = new ArrayList<ItemStack>(items.size() + armor.size() + extraSlots.size()); + List<ItemStack> combined = new ArrayList<ItemStack>(items.size() + armor.size() + extraSlots.size());
+ for (List<net.minecraft.server.ItemStack> sub : this.g) { + for (List<net.minecraft.server.ItemStack> sub : this.f) {
+ combined.addAll(sub); + combined.addAll(sub);
+ } + }
+ +
@ -66,12 +66,6 @@
public PlayerInventory(EntityHuman entityhuman) { public PlayerInventory(EntityHuman entityhuman) {
this.items = NonNullList.a(36, ItemStack.a); this.items = NonNullList.a(36, ItemStack.a);
this.armor = NonNullList.a(4, ItemStack.a); this.armor = NonNullList.a(4, ItemStack.a);
this.extraSlots = NonNullList.a(1, ItemStack.a);
- this.g = Arrays.asList(new NonNullList[] { this.items, this.armor, this.extraSlots});
+ this.g = (List) Arrays.asList(new NonNullList[] { this.items, this.armor, this.extraSlots}); // CraftBukkit - decompile error
this.carried = ItemStack.a;
this.player = entityhuman;
}
@@ -41,6 +93,23 @@ @@ -41,6 +93,23 @@
return itemstack.getItem() == itemstack1.getItem() && (!itemstack.usesData() || itemstack.getData() == itemstack1.getData()) && ItemStack.equals(itemstack, itemstack1); return itemstack.getItem() == itemstack1.getItem() && (!itemstack.usesData() || itemstack.getData() == itemstack1.getData()) && ItemStack.equals(itemstack, itemstack1);
} }

Datei anzeigen

@ -840,7 +840,7 @@
@@ -775,16 +1226,21 @@ @@ -775,16 +1226,21 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition)); entityplayer.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
if (worldserver.Y()) { if (worldserver.isRaining()) {
- entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(1, 0.0F)); - entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(1, 0.0F));
- entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, worldserver.j(1.0F))); - entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, worldserver.j(1.0F)));
- entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, worldserver.h(1.0F))); - entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, worldserver.h(1.0F)));

Datei anzeigen

@ -24,8 +24,8 @@
+ // CraftBukkit start - Construct a dummy repair recipe + // CraftBukkit start - Construct a dummy repair recipe
+ ItemStack result = new ItemStack(itemstack.getItem(), 1, i1); + ItemStack result = new ItemStack(itemstack.getItem(), 1, i1);
+ NonNullList<RecipeItemStack> ingredients = NonNullList.a(); + NonNullList<RecipeItemStack> ingredients = NonNullList.a();
+ ingredients.add(new RecipeItemStack(itemstack2.cloneItemStack())); + ingredients.add(RecipeItemStack.a(new ItemStack[]{itemstack2.cloneItemStack()}));
+ ingredients.add(new RecipeItemStack(itemstack.cloneItemStack())); + ingredients.add(RecipeItemStack.a(new ItemStack[]{itemstack.cloneItemStack()}));
+ ShapelessRecipes recipe = new ShapelessRecipes(this.a, result.cloneItemStack(), ingredients); + ShapelessRecipes recipe = new ShapelessRecipes(this.a, result.cloneItemStack(), ingredients);
+ recipe.key = new MinecraftKey("repairitem"); + recipe.key = new MinecraftKey("repairitem");
+ inventorycrafting.currentRecipe = recipe; + inventorycrafting.currentRecipe = recipe;

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ShapedRecipes.java --- a/net/minecraft/server/ShapedRecipes.java
+++ b/net/minecraft/server/ShapedRecipes.java +++ b/net/minecraft/server/ShapedRecipes.java
@@ -12,6 +12,10 @@ @@ -14,6 +14,10 @@
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -11,7 +11,7 @@
public class ShapedRecipes extends IRecipe { public class ShapedRecipes extends IRecipe {
@@ -28,6 +32,63 @@ @@ -30,6 +34,63 @@
this.result = itemstack; this.result = itemstack;
} }

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/ShapelessRecipes.java --- a/net/minecraft/server/ShapelessRecipes.java
+++ b/net/minecraft/server/ShapelessRecipes.java +++ b/net/minecraft/server/ShapelessRecipes.java
@@ -5,6 +5,10 @@ @@ -6,6 +6,10 @@
import com.google.gson.JsonObject; import com.google.gson.JsonParseException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
+// CraftBukkit start +// CraftBukkit start
@ -11,7 +11,7 @@
public class ShapelessRecipes extends IRecipe { public class ShapelessRecipes extends IRecipe {
@@ -17,6 +21,21 @@ @@ -18,6 +22,21 @@
this.ingredients = nonnulllist; this.ingredients = nonnulllist;
} }

Datei anzeigen

@ -56,9 +56,9 @@
ChatClickable chatclickable = chatmodifier.h(); ChatClickable chatclickable = chatmodifier.h();
if (chatclickable.a() == ChatClickable.EnumClickAction.RUN_COMMAND) { if (chatclickable.a() == ChatClickable.EnumClickAction.RUN_COMMAND) {
- entityhuman.C_().getCommandHandler().b(icommandlistener, chatclickable.b()); - entityhuman.C_().getCommandHandler().a(icommandlistener, chatclickable.b());
+ // CraftBukkit start + // CraftBukkit start
+ // entityhuman.C_().getCommandHandler().b(icommandlistener, chatclickable.b()); + // entityhuman.C_().getCommandHandler().a(icommandlistener, chatclickable.b());
+ CommandBlockListenerAbstract.executeSafely(icommandlistener, new org.bukkit.craftbukkit.command.ProxiedNativeCommandSender( + CommandBlockListenerAbstract.executeSafely(icommandlistener, new org.bukkit.craftbukkit.command.ProxiedNativeCommandSender(
+ icommandlistener, + icommandlistener,
+ new org.bukkit.craftbukkit.command.CraftBlockCommandSender(icommandlistener), + new org.bukkit.craftbukkit.command.CraftBlockCommandSender(icommandlistener),

Datei anzeigen

@ -198,7 +198,7 @@
+ +
+ if (!this.isClientSide && (i & 1) != 0) { + if (!this.isClientSide && (i & 1) != 0) {
+ this.update(blockposition, oldBlock.getBlock(), true); + this.update(blockposition, oldBlock.getBlock(), true);
+ if (newBlock.o()) { + if (newBlock.n()) {
+ this.updateAdjacentComparators(blockposition, newBlock.getBlock()); + this.updateAdjacentComparators(blockposition, newBlock.getBlock());
+ } + }
+ } else if (!this.isClientSide && (i & 16) == 0) { + } else if (!this.isClientSide && (i & 16) == 0) {
@ -448,27 +448,15 @@
} }
} }
} }
@@ -1245,7 +1494,10 @@ @@ -1252,6 +1501,7 @@
int j = MathHelper.floor(entity.locZ); entity.leaveVehicle();
boolean flag1 = true; } else {
entity.B_();
- if (!flag || this.isAreaLoaded(i - 32, 0, j - 32, i + 32, 0, j + 32, true)) { + entity.postTick(); // CraftBukkit
+ // CraftBukkit start - Use neighbor cache instead of looking up
+ Chunk startingChunk = this.getChunkIfLoaded(i >> 4, j >> 4);
+ if (!flag || (startingChunk != null && startingChunk.areNeighborsLoaded(2)) /* this.isAreaLoaded(i - b0, 0, j - b0, i + b0, 0, j + b0) */) {
+ // CraftBukkit end
entity.M = entity.locX;
entity.N = entity.locY;
entity.O = entity.locZ;
@@ -1257,6 +1509,7 @@
entity.leaveVehicle();
} else {
entity.B_();
+ entity.postTick(); // CraftBukkit
}
} }
}
@@ -1549,11 +1802,18 @@ @@ -1543,11 +1793,18 @@
} }
} }
@ -487,7 +475,7 @@
TileEntity tileentity = null; TileEntity tileentity = null;
if (this.O) { if (this.O) {
@@ -1588,6 +1848,14 @@ @@ -1582,6 +1839,14 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!this.E(blockposition)) { if (!this.E(blockposition)) {
if (tileentity != null && !tileentity.y()) { if (tileentity != null && !tileentity.y()) {
@ -502,7 +490,7 @@
if (this.O) { if (this.O) {
tileentity.setPosition(blockposition); tileentity.setPosition(blockposition);
Iterator iterator = this.b.iterator(); Iterator iterator = this.b.iterator();
@@ -1747,6 +2015,14 @@ @@ -1741,6 +2006,14 @@
} }
this.o = MathHelper.a(this.o, 0.0F, 1.0F); this.o = MathHelper.a(this.o, 0.0F, 1.0F);
@ -517,7 +505,7 @@
} }
} }
} }
@@ -1878,7 +2154,10 @@ @@ -1878,7 +2151,10 @@
} }
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) { public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
@ -529,7 +517,7 @@
return false; return false;
} else { } else {
int i = 0; int i = 0;
@@ -2045,7 +2324,7 @@ @@ -2045,7 +2321,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -538,7 +526,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -2060,7 +2339,7 @@ @@ -2060,7 +2336,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -547,7 +535,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -2109,7 +2388,7 @@ @@ -2109,7 +2385,7 @@
} }
} }
@ -556,7 +544,7 @@
} }
@Nullable @Nullable
@@ -2130,8 +2409,17 @@ @@ -2130,8 +2406,17 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -575,7 +563,7 @@
++i; ++i;
} }
} }
@@ -2140,12 +2428,18 @@ @@ -2140,12 +2425,18 @@
} }
public void a(Collection<Entity> collection) { public void a(Collection<Entity> collection) {
@ -595,9 +583,9 @@
this.b(entity); this.b(entity);
} }
@@ -2159,7 +2453,13 @@ @@ -2159,7 +2450,13 @@
IBlockData iblockdata = this.getType(blockposition); IBlockData iblockdata = this.getType(blockposition);
AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().c(this, blockposition); AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().d(this, blockposition);
- return axisalignedbb != Block.k && !this.a(axisalignedbb.a(blockposition), entity) ? false : (iblockdata.getMaterial() == Material.ORIENTABLE && block == Blocks.ANVIL ? true : iblockdata.getMaterial().isReplaceable() && block.canPlace(this, blockposition, enumdirection)); - return axisalignedbb != Block.k && !this.a(axisalignedbb.a(blockposition), entity) ? false : (iblockdata.getMaterial() == Material.ORIENTABLE && block == Blocks.ANVIL ? true : iblockdata.getMaterial().isReplaceable() && block.canPlace(this, blockposition, enumdirection));
+ // CraftBukkit start - store default return + // CraftBukkit start - store default return
@ -610,7 +598,7 @@
} }
public int getSeaLevel() { public int getSeaLevel() {
@@ -2269,6 +2569,11 @@ @@ -2269,6 +2566,11 @@
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i); EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
@ -622,7 +610,7 @@
if (predicate.apply(entityhuman1)) { if (predicate.apply(entityhuman1)) {
double d5 = entityhuman1.d(d0, d1, d2); double d5 = entityhuman1.d(d0, d1, d2);
@@ -2437,6 +2742,16 @@ @@ -2437,6 +2739,16 @@
public void everyoneSleeping() {} public void everyoneSleeping() {}
@ -639,7 +627,7 @@
public float h(float f) { public float h(float f) {
return (this.p + (this.q - this.p) * f) * this.j(f); return (this.p + (this.q - this.p) * f) * this.j(f);
} }
@@ -2654,7 +2969,7 @@ @@ -2654,7 +2966,7 @@
int l = j * 16 + 8 - blockposition.getZ(); int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true; boolean flag = true;

Datei anzeigen

@ -591,12 +591,8 @@
} }
} }
@@ -980,9 +1232,10 @@ @@ -983,6 +1235,7 @@
} boolean flag = this.isRaining();
protected void t() {
- boolean flag = this.Y();
+ boolean flag = this.Y(); // PAIL: rename
super.t(); super.t();
+ /* CraftBukkit start + /* CraftBukkit start
@ -608,7 +604,7 @@
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.q)); this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.q));
} }
+ // */ + // */
+ if (flag != this.Y()) { + if (flag != this.isRaining()) {
+ // Only send weather packets to those affected + // Only send weather packets to those affected
+ for (int i = 0; i < this.players.size(); ++i) { + for (int i = 0; i < this.players.size(); ++i) {
+ if (((EntityPlayer) this.players.get(i)).world == this) { + if (((EntityPlayer) this.players.get(i)).world == this) {

Datei anzeigen

@ -4,14 +4,14 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.12-pre2-SNAPSHOT</version> <version>1.12-pre5-SNAPSHOT</version>
<name>CraftBukkit</name> <name>CraftBukkit</name>
<url>http://www.bukkit.org</url> <url>http://www.bukkit.org</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version> <api.version>unknown</api.version>
<minecraft.version>1.12-pre2</minecraft.version> <minecraft.version>1.12-pre5</minecraft.version>
<minecraft_version>1_12_R1</minecraft_version> <minecraft_version>1_12_R1</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix> <buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix> <buildtag.suffix></buildtag.suffix>

Datei anzeigen

@ -551,13 +551,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@Override @Override
public void setAI(boolean ai) { public void setAI(boolean ai) {
if (this.getHandle() instanceof EntityInsentient) { if (this.getHandle() instanceof EntityInsentient) {
((EntityInsentient) this.getHandle()).setAI(!ai); ((EntityInsentient) this.getHandle()).setNoAI(!ai);
} }
} }
@Override @Override
public boolean hasAI() { public boolean hasAI() {
return (this.getHandle() instanceof EntityInsentient) ? !((EntityInsentient) this.getHandle()).hasAI(): false; return (this.getHandle() instanceof EntityInsentient) ? !((EntityInsentient) this.getHandle()).isNoAI(): false;
} }
@Override @Override

Datei anzeigen

@ -51,7 +51,7 @@ public class CraftShapedRecipe extends ShapedRecipe implements CraftRecipe {
for (int i = 0; i < shape.length; i++) { for (int i = 0; i < shape.length; i++) {
String row = shape[i]; String row = shape[i];
for (int j = 0; j < row.length(); j++) { for (int j = 0; j < row.length(); j++) {
data.set(i * width + j, new RecipeItemStack(CraftItemStack.asNMSCopy(ingred.get(row.charAt(j))))); data.set(i * width + j, RecipeItemStack.a(new net.minecraft.server.ItemStack[]{CraftItemStack.asNMSCopy(ingred.get(row.charAt(j)))}));
} }
} }

Datei anzeigen

@ -40,7 +40,7 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe
List<ItemStack> ingred = this.getIngredientList(); List<ItemStack> ingred = this.getIngredientList();
NonNullList<RecipeItemStack> data = NonNullList.a(ingred.size(), RecipeItemStack.a); NonNullList<RecipeItemStack> data = NonNullList.a(ingred.size(), RecipeItemStack.a);
for (int i = 0; i < ingred.size(); i++) { for (int i = 0; i < ingred.size(); i++) {
data.set(i, new RecipeItemStack(CraftItemStack.asNMSCopy(ingred.get(i)))); data.set(i, RecipeItemStack.a(new net.minecraft.server.ItemStack[]{CraftItemStack.asNMSCopy(ingred.get(i))}));
} }
CraftingManager.a(CraftNamespacedKey.toMinecraft(this.getKey()), new ShapelessRecipes("", CraftItemStack.asNMSCopy(this.getResult()), data)); CraftingManager.a(CraftNamespacedKey.toMinecraft(this.getKey()), new ShapelessRecipes("", CraftItemStack.asNMSCopy(this.getResult()), data));