Organise imports

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-03-09 08:47:33 +11:00
parent 1ae7bcc4d0
commit b2efd58164
188 changed files with 879 additions and 825 deletions

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/BehaviorAttackTargetForget.java --- a/net/minecraft/server/BehaviorAttackTargetForget.java
+++ b/net/minecraft/server/BehaviorAttackTargetForget.java +++ b/net/minecraft/server/BehaviorAttackTargetForget.java
@@ -3,6 +3,11 @@ @@ -4,6 +4,12 @@
import com.google.common.collect.ImmutableMap;
import java.util.Optional; import java.util.Optional;
import java.util.function.Predicate; import java.util.function.Predicate;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class BehaviorAttackTargetForget<E extends EntityInsentient> extends Behavior<E> { public class BehaviorAttackTargetForget<E extends EntityInsentient> extends Behavior<E> {
@@ -54,6 +59,17 @@ private final Predicate<EntityLiving> b;
@@ -54,6 +60,17 @@
} }
private void d(E e0) { private void d(E e0) {

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/BehaviorAttackTargetSet.java --- a/net/minecraft/server/BehaviorAttackTargetSet.java
+++ b/net/minecraft/server/BehaviorAttackTargetSet.java +++ b/net/minecraft/server/BehaviorAttackTargetSet.java
@@ -4,6 +4,11 @@ @@ -5,6 +5,12 @@
import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Predicate; import java.util.function.Predicate;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class BehaviorAttackTargetSet<E extends EntityInsentient> extends Behavior<E> { public class BehaviorAttackTargetSet<E extends EntityInsentient> extends Behavior<E> {
@@ -33,13 +38,21 @@ private final Predicate<E> b;
@@ -33,13 +39,21 @@
} }
protected void a(WorldServer worldserver, E e0, long i) { protected void a(WorldServer worldserver, E e0, long i) {

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/BehaviorCareer.java --- a/net/minecraft/server/BehaviorCareer.java
+++ b/net/minecraft/server/BehaviorCareer.java +++ b/net/minecraft/server/BehaviorCareer.java
@@ -2,6 +2,11 @@ @@ -3,6 +3,12 @@
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import java.util.Optional; import java.util.Optional;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftVillager; +import org.bukkit.craftbukkit.entity.CraftVillager;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.VillagerCareerChangeEvent; +import org.bukkit.event.entity.VillagerCareerChangeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class BehaviorCareer extends Behavior<EntityVillager> { public class BehaviorCareer extends Behavior<EntityVillager> {
@@ -19,7 +24,7 @@ public BehaviorCareer() {
@@ -19,7 +25,7 @@
GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get(); GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get();
entityvillager.getBehaviorController().removeMemory(MemoryModuleType.POTENTIAL_JOB_SITE); entityvillager.getBehaviorController().removeMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
@ -21,7 +22,7 @@
worldserver.broadcastEntityEffect(entityvillager, (byte) 14); worldserver.broadcastEntityEffect(entityvillager, (byte) 14);
if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) { if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) {
MinecraftServer minecraftserver = worldserver.getMinecraftServer(); MinecraftServer minecraftserver = worldserver.getMinecraftServer();
@@ -31,7 +36,14 @@ @@ -31,7 +37,14 @@
return villagerprofession.b() == villageplacetype; return villagerprofession.b() == villageplacetype;
}).findFirst(); }).findFirst();
}).ifPresent((villagerprofession) -> { }).ifPresent((villagerprofession) -> {

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/BehaviorProfession.java --- a/net/minecraft/server/BehaviorProfession.java
+++ b/net/minecraft/server/BehaviorProfession.java +++ b/net/minecraft/server/BehaviorProfession.java
@@ -1,6 +1,11 @@ @@ -2,6 +2,12 @@
package net.minecraft.server;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftVillager; +import org.bukkit.craftbukkit.entity.CraftVillager;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.VillagerCareerChangeEvent; +import org.bukkit.event.entity.VillagerCareerChangeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class BehaviorProfession extends Behavior<EntityVillager> { public class BehaviorProfession extends Behavior<EntityVillager> {
@@ -15,7 +20,14 @@ public BehaviorProfession() {
@@ -15,7 +21,14 @@
} }
protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) { protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) {

View File

@ -1,14 +1,14 @@
--- a/net/minecraft/server/BlockComposter.java --- a/net/minecraft/server/BlockComposter.java
+++ b/net/minecraft/server/BlockComposter.java +++ b/net/minecraft/server/BlockComposter.java
@@ -4,13 +4,17 @@ @@ -5,12 +5,17 @@
import it.unimi.dsi.fastutil.objects.Object2FloatOpenHashMap;
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftBlockInventoryHolder; +import org.bukkit.craftbukkit.inventory.CraftBlockInventoryHolder;
+import org.bukkit.craftbukkit.util.DummyGeneratorAccess; +import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
+// CraftBukkit end +// CraftBukkit end
+
public class BlockComposter extends Block implements IInventoryHolder { public class BlockComposter extends Block implements IInventoryHolder {
public static final BlockStateInteger a = BlockProperties.as; public static final BlockStateInteger a = BlockProperties.as;
@ -19,7 +19,7 @@
for (int i = 0; i < 8; ++i) { for (int i = 0; i < 8; ++i) {
avoxelshape[i] = VoxelShapes.a(BlockComposter.c, Block.a(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), OperatorBoolean.ONLY_FIRST); avoxelshape[i] = VoxelShapes.a(BlockComposter.c, Block.a(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), OperatorBoolean.ONLY_FIRST);
} }
@@ -156,18 +160,25 @@ @@ -156,18 +161,25 @@
return EnumInteractionResult.a(world.isClientSide); return EnumInteractionResult.a(world.isClientSide);
} else if (i == 8) { } else if (i == 8) {
@ -48,7 +48,7 @@
itemstack.subtract(1); itemstack.subtract(1);
return iblockdata1; return iblockdata1;
@@ -176,7 +187,15 @@ @@ -176,7 +188,15 @@
} }
} }
@ -65,7 +65,7 @@
if (!world.isClientSide) { if (!world.isClientSide) {
float f = 0.7F; float f = 0.7F;
double d0 = (double) (world.random.nextFloat() * 0.7F) + 0.15000000596046448D; double d0 = (double) (world.random.nextFloat() * 0.7F) + 0.15000000596046448D;
@@ -202,10 +221,16 @@ @@ -202,10 +222,16 @@
} }
private static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, ItemStack itemstack) { private static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, ItemStack itemstack) {
@ -83,7 +83,7 @@
return iblockdata; return iblockdata;
} else { } else {
int j = i + 1; int j = i + 1;
@@ -253,7 +278,8 @@ @@ -253,7 +279,8 @@
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
int i = (Integer) iblockdata.get(BlockComposter.a); int i = (Integer) iblockdata.get(BlockComposter.a);
@ -93,7 +93,7 @@
} }
static class ContainerInput extends InventorySubcontainer implements IWorldInventory { static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
@@ -265,6 +291,7 @@ @@ -265,6 +292,7 @@
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
super(1); super(1);
@ -101,7 +101,7 @@
this.a = iblockdata; this.a = iblockdata;
this.b = generatoraccess; this.b = generatoraccess;
this.c = blockposition; this.c = blockposition;
@@ -317,6 +344,7 @@ @@ -317,6 +345,7 @@
this.blockData = iblockdata; this.blockData = iblockdata;
this.generatorAccess = generatoraccess; this.generatorAccess = generatoraccess;
this.blockPosition = blockposition; this.blockPosition = blockposition;
@ -109,7 +109,7 @@
} }
@Override @Override
@@ -341,15 +369,23 @@ @@ -341,15 +370,23 @@
@Override @Override
public void update() { public void update() {

View File

@ -1,20 +1,17 @@
--- a/net/minecraft/server/BlockPortal.java --- a/net/minecraft/server/BlockPortal.java
+++ b/net/minecraft/server/BlockPortal.java +++ b/net/minecraft/server/BlockPortal.java
@@ -2,6 +2,13 @@ @@ -2,6 +2,10 @@
import java.util.Random; import java.util.Random;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.block.CraftBlockState;
+import org.bukkit.event.entity.EntityPortalEnterEvent; +import org.bukkit.event.entity.EntityPortalEnterEvent;
+import org.bukkit.event.world.PortalCreateEvent;
+// CraftBukkit end +// CraftBukkit end
+ +
public class BlockPortal extends Block { public class BlockPortal extends Block {
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.E; public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.E;
@@ -32,7 +39,8 @@ @@ -32,7 +36,8 @@
} }
if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) { if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) {
@ -24,7 +21,7 @@
if (entity != null) { if (entity != null) {
entity.resetPortalCooldown(); entity.resetPortalCooldown();
@@ -54,6 +62,10 @@ @@ -54,6 +59,10 @@
@Override @Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.canPortal()) { if (!entity.isPassenger() && !entity.isVehicle() && entity.canPortal()) {

View File

@ -1,19 +1,18 @@
--- a/net/minecraft/server/BlockPumpkinCarved.java --- a/net/minecraft/server/BlockPumpkinCarved.java
+++ b/net/minecraft/server/BlockPumpkinCarved.java +++ b/net/minecraft/server/BlockPumpkinCarved.java
@@ -4,6 +4,12 @@ @@ -4,6 +4,11 @@
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.util.BlockStateListPopulator; +import org.bukkit.craftbukkit.util.BlockStateListPopulator;
+import org.bukkit.event.block.BlockRedstoneEvent;
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
+// CraftBukkit end +// CraftBukkit end
+ +
public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWearable { public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWearable {
public static final BlockStateDirection a = BlockFacingHorizontal.FACING; public static final BlockStateDirection a = BlockFacingHorizontal.FACING;
@@ -42,19 +48,28 @@ @@ -42,19 +47,28 @@
EntityPlayer entityplayer; EntityPlayer entityplayer;
int j; int j;
@ -45,7 +44,7 @@
iterator = world.a(EntityPlayer.class, entitysnowman.getBoundingBox().g(5.0D)).iterator(); iterator = world.a(EntityPlayer.class, entitysnowman.getBoundingBox().g(5.0D)).iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -74,8 +89,8 @@ @@ -74,8 +88,8 @@
for (int k = 0; k < this.getIronGolemShape().b(); ++k) { for (int k = 0; k < this.getIronGolemShape().b(); ++k) {
ShapeDetectorBlock shapedetectorblock2 = shapedetector_shapedetectorcollection.a(i, k, 0); ShapeDetectorBlock shapedetectorblock2 = shapedetector_shapedetectorcollection.a(i, k, 0);
@ -56,7 +55,7 @@
} }
} }
@@ -84,7 +99,15 @@ @@ -84,7 +98,15 @@
entityirongolem.setPlayerCreated(true); entityirongolem.setPlayerCreated(true);
entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F); entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F);

View File

@ -1,19 +1,20 @@
--- a/net/minecraft/server/BlockSponge.java --- a/net/minecraft/server/BlockSponge.java
+++ b/net/minecraft/server/BlockSponge.java +++ b/net/minecraft/server/BlockSponge.java
@@ -2,6 +2,12 @@ @@ -3,6 +3,13 @@
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import java.util.Queue; import java.util.Queue;
+// CraftBukkit start +// CraftBukkit start
+import java.util.List; +import java.util.List;
+import org.bukkit.craftbukkit.block.CraftBlockState; +import org.bukkit.craftbukkit.block.CraftBlockState;
+import org.bukkit.craftbukkit.util.BlockStateListPopulator; +import org.bukkit.craftbukkit.util.BlockStateListPopulator;
+import org.bukkit.event.block.SpongeAbsorbEvent; +import org.bukkit.event.block.SpongeAbsorbEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class BlockSponge extends Block { public class BlockSponge extends Block {
@@ -35,6 +41,7 @@ protected BlockSponge(BlockBase.Info blockbase_info) {
@@ -35,6 +42,7 @@
queue.add(new Tuple<>(blockposition, 0)); queue.add(new Tuple<>(blockposition, 0));
int i = 0; int i = 0;
@ -21,7 +22,7 @@
while (!queue.isEmpty()) { while (!queue.isEmpty()) {
Tuple<BlockPosition, Integer> tuple = (Tuple) queue.poll(); Tuple<BlockPosition, Integer> tuple = (Tuple) queue.poll();
@@ -46,27 +53,31 @@ @@ -46,27 +54,31 @@
for (int l = 0; l < k; ++l) { for (int l = 0; l < k; ++l) {
EnumDirection enumdirection = aenumdirection[l]; EnumDirection enumdirection = aenumdirection[l];
BlockPosition blockposition2 = blockposition1.shift(enumdirection); BlockPosition blockposition2 = blockposition1.shift(enumdirection);
@ -60,7 +61,7 @@
++i; ++i;
if (j < 6) { if (j < 6) {
queue.add(new Tuple<>(blockposition2, j + 1)); queue.add(new Tuple<>(blockposition2, j + 1));
@@ -79,6 +90,39 @@ @@ -79,6 +91,39 @@
break; break;
} }
} }

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/BlockSweetBerryBush.java --- a/net/minecraft/server/BlockSweetBerryBush.java
+++ b/net/minecraft/server/BlockSweetBerryBush.java +++ b/net/minecraft/server/BlockSweetBerryBush.java
@@ -1,6 +1,13 @@ @@ -2,6 +2,14 @@
package net.minecraft.server;
import java.util.Random; import java.util.Random;
+// CraftBukkit start +// CraftBukkit start
+import java.util.Collections; +import java.util.Collections;
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
@ -11,10 +11,11 @@
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.player.PlayerHarvestBlockEvent; +import org.bukkit.event.player.PlayerHarvestBlockEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement { public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement {
@@ -28,7 +35,7 @@ public static final BlockStateInteger a = BlockProperties.ag;
@@ -28,7 +36,7 @@
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a); int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
if (i < 3 && random.nextInt(5) == 0 && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { if (i < 3 && random.nextInt(5) == 0 && worldserver.getLightLevel(blockposition.up(), 0) >= 9) {
@ -23,7 +24,7 @@
} }
} }
@@ -42,7 +49,9 @@ @@ -42,7 +50,9 @@
double d1 = Math.abs(entity.locZ() - entity.F); double d1 = Math.abs(entity.locZ() - entity.F);
if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) { if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) {
@ -33,7 +34,7 @@
} }
} }
@@ -59,7 +68,15 @@ @@ -59,7 +69,15 @@
} else if (i > 1) { } else if (i > 1) {
int j = 1 + world.random.nextInt(2); int j = 1 + world.random.nextInt(2);

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/BlockTrapdoor.java --- a/net/minecraft/server/BlockTrapdoor.java
+++ b/net/minecraft/server/BlockTrapdoor.java +++ b/net/minecraft/server/BlockTrapdoor.java
@@ -1,6 +1,7 @@ @@ -2,6 +2,8 @@
package net.minecraft.server;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged { public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged {
@@ -88,6 +89,19 @@ public static final BlockStateBoolean OPEN = BlockProperties.u;
@@ -88,6 +90,19 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition); boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
if (flag1 != (Boolean) iblockdata.get(BlockTrapdoor.c)) { if (flag1 != (Boolean) iblockdata.get(BlockTrapdoor.c)) {

View File

@ -1,18 +1,18 @@
--- a/net/minecraft/server/BlockTurtleEgg.java --- a/net/minecraft/server/BlockTurtleEgg.java
+++ b/net/minecraft/server/BlockTurtleEgg.java +++ b/net/minecraft/server/BlockTurtleEgg.java
@@ -2,6 +2,12 @@ @@ -3,6 +3,12 @@
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.block.CraftBlock;
+
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.event.entity.EntityInteractEvent; +import org.bukkit.event.entity.EntityInteractEvent;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end +// CraftBukkit end
+
public class BlockTurtleEgg extends Block { public class BlockTurtleEgg extends Block {
private static final VoxelShape c = Block.a(3.0D, 0.0D, 3.0D, 12.0D, 7.0D, 12.0D);
@@ -36,6 +42,19 @@ @@ -36,6 +42,19 @@
IBlockData iblockdata = world.getType(blockposition); IBlockData iblockdata = world.getType(blockposition);

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/ChestLock.java --- a/net/minecraft/server/ChestLock.java
+++ b/net/minecraft/server/ChestLock.java +++ b/net/minecraft/server/ChestLock.java
@@ -1,6 +1,10 @@ @@ -2,6 +2,11 @@
package net.minecraft.server;
import javax.annotation.concurrent.Immutable; import javax.annotation.concurrent.Immutable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.ChatColor; +import org.bukkit.ChatColor;
+import org.bukkit.craftbukkit.util.CraftChatMessage; +import org.bukkit.craftbukkit.util.CraftChatMessage;
+// CraftBukkit end +// CraftBukkit end
+
@Immutable @Immutable
public class ChestLock { public class ChestLock {
@@ -13,7 +17,19 @@
@@ -13,7 +18,19 @@
} }
public boolean a(ItemStack itemstack) { public boolean a(ItemStack itemstack) {

View File

@ -1,25 +1,17 @@
--- a/net/minecraft/server/CommandBlockListenerAbstract.java --- a/net/minecraft/server/CommandBlockListenerAbstract.java
+++ b/net/minecraft/server/CommandBlockListenerAbstract.java +++ b/net/minecraft/server/CommandBlockListenerAbstract.java
@@ -4,6 +4,7 @@ @@ -17,6 +17,10 @@
import java.util.Date;
import java.util.UUID;
import javax.annotation.Nullable;
+import org.bukkit.command.CommandSender;
public abstract class CommandBlockListenerAbstract implements ICommandListener {
@@ -17,6 +18,10 @@
private IChatBaseComponent lastOutput; private IChatBaseComponent lastOutput;
private String command = ""; private String command = "";
private IChatBaseComponent customName; private IChatBaseComponent customName;
+ // CraftBukkit start + // CraftBukkit start
+ @Override + @Override
+ public abstract CommandSender getBukkitSender(CommandListenerWrapper wrapper); + public abstract org.bukkit.command.CommandSender getBukkitSender(CommandListenerWrapper wrapper);
+ // CraftBukkit end + // CraftBukkit end
public CommandBlockListenerAbstract() { public CommandBlockListenerAbstract() {
this.customName = CommandBlockListenerAbstract.c; this.customName = CommandBlockListenerAbstract.c;
@@ -113,7 +118,7 @@ @@ -113,7 +117,7 @@
}); });

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/CommandListenerWrapper.java --- a/net/minecraft/server/CommandListenerWrapper.java
+++ b/net/minecraft/server/CommandListenerWrapper.java +++ b/net/minecraft/server/CommandListenerWrapper.java
@@ -7,6 +7,7 @@ @@ -15,6 +15,8 @@
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; import java.util.stream.Stream;
import com.mojang.brigadier.suggestion.Suggestions; import javax.annotation.Nullable;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
+import com.mojang.brigadier.tree.CommandNode; +import com.mojang.brigadier.tree.CommandNode; // CraftBukkit
import java.util.Collection; +
import java.util.Iterator; public class CommandListenerWrapper implements ICompletionProvider {
import java.util.Set;
@@ -32,6 +33,7 @@ public static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("permissions.requires.player"));
@@ -32,6 +34,7 @@
private final ResultConsumer<CommandListenerWrapper> l; private final ResultConsumer<CommandListenerWrapper> l;
private final ArgumentAnchor.Anchor m; private final ArgumentAnchor.Anchor m;
private final Vec2F n; private final Vec2F n;
@ -16,7 +17,7 @@
public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) { public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) {
this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, j) -> { this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, j) -> {
@@ -128,9 +130,23 @@ @@ -128,9 +131,23 @@
@Override @Override
public boolean hasPermission(int i) { public boolean hasPermission(int i) {
@ -40,7 +41,7 @@
public Vec3D getPosition() { public Vec3D getPosition() {
return this.d; return this.d;
} }
@@ -192,7 +208,7 @@ @@ -192,7 +209,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next(); EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@ -49,7 +50,7 @@
entityplayer.sendMessage(ichatmutablecomponent, SystemUtils.b); entityplayer.sendMessage(ichatmutablecomponent, SystemUtils.b);
} }
} }
@@ -252,4 +268,10 @@ @@ -252,4 +269,10 @@
public IRegistryCustom q() { public IRegistryCustom q() {
return this.i.getCustomRegistry(); return this.i.getCustomRegistry();
} }

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/CommandTeleport.java --- a/net/minecraft/server/CommandTeleport.java
+++ b/net/minecraft/server/CommandTeleport.java +++ b/net/minecraft/server/CommandTeleport.java
@@ -12,6 +12,11 @@ @@ -13,6 +13,12 @@
import java.util.Iterator;
import java.util.Set; import java.util.Set;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.event.entity.EntityTeleportEvent; +import org.bukkit.event.entity.EntityTeleportEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class CommandTeleport { public class CommandTeleport {
@@ -128,9 +133,9 @@ private static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("commands.teleport.invalidPosition"));
@@ -128,9 +134,9 @@
} }
if (worldserver == entity.world) { if (worldserver == entity.world) {
@ -24,7 +25,7 @@
} }
entity.setHeadRotation(f); entity.setHeadRotation(f);
@@ -139,6 +144,21 @@ @@ -139,6 +145,21 @@
float f3 = MathHelper.g(f1); float f3 = MathHelper.g(f1);
f3 = MathHelper.a(f3, -90.0F, 90.0F); f3 = MathHelper.a(f3, -90.0F, 90.0F);

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/CommandTime.java --- a/net/minecraft/server/CommandTime.java
+++ b/net/minecraft/server/CommandTime.java +++ b/net/minecraft/server/CommandTime.java
@@ -4,6 +4,10 @@ @@ -5,6 +5,11 @@
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import java.util.Iterator; import java.util.Iterator;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.event.world.TimeSkipEvent; +import org.bukkit.event.world.TimeSkipEvent;
+// CrafBukkit end +// CraftBukkit end
+
public class CommandTime { public class CommandTime {
@@ -46,7 +50,13 @@ public static void a(com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) {
@@ -46,7 +51,13 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next(); WorldServer worldserver = (WorldServer) iterator.next();
@ -26,7 +27,7 @@
} }
commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", new Object[]{i}), true); commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", new Object[]{i}), true);
@@ -59,7 +69,13 @@ @@ -59,7 +70,13 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next(); WorldServer worldserver = (WorldServer) iterator.next();

View File

@ -1,11 +1,10 @@
--- a/net/minecraft/server/ContainerEnchantTable.java --- a/net/minecraft/server/ContainerEnchantTable.java
+++ b/net/minecraft/server/ContainerEnchantTable.java +++ b/net/minecraft/server/ContainerEnchantTable.java
@@ -3,6 +3,21 @@ @@ -3,6 +3,20 @@
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
+// CraftBukkit start +// CraftBukkit start
+import java.util.Collections;
+import java.util.Map; +import java.util.Map;
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.NamespacedKey; +import org.bukkit.NamespacedKey;
@ -22,7 +21,7 @@
public class ContainerEnchantTable extends Container { public class ContainerEnchantTable extends Container {
private final IInventory enchantSlots; private final IInventory enchantSlots;
@@ -12,6 +27,10 @@ @@ -12,6 +26,10 @@
public final int[] costs; public final int[] costs;
public final int[] enchantments; public final int[] enchantments;
public final int[] levels; public final int[] levels;
@ -33,7 +32,7 @@
public ContainerEnchantTable(int i, PlayerInventory playerinventory) { public ContainerEnchantTable(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a); this(i, playerinventory, ContainerAccess.a);
@@ -25,6 +44,13 @@ @@ -25,6 +43,13 @@
super.update(); super.update();
ContainerEnchantTable.this.a((IInventory) this); ContainerEnchantTable.this.a((IInventory) this);
} }
@ -47,7 +46,7 @@
}; };
this.h = new Random(); this.h = new Random();
this.i = ContainerProperty.a(); this.i = ContainerProperty.a();
@@ -72,6 +98,9 @@ @@ -72,6 +97,9 @@
this.a(ContainerProperty.a(this.levels, 0)); this.a(ContainerProperty.a(this.levels, 0));
this.a(ContainerProperty.a(this.levels, 1)); this.a(ContainerProperty.a(this.levels, 1));
this.a(ContainerProperty.a(this.levels, 2)); this.a(ContainerProperty.a(this.levels, 2));
@ -57,7 +56,7 @@
} }
@Override @Override
@@ -79,7 +108,7 @@ @@ -79,7 +107,7 @@
if (iinventory == this.enchantSlots) { if (iinventory == this.enchantSlots) {
ItemStack itemstack = iinventory.getItem(0); ItemStack itemstack = iinventory.getItem(0);
@ -66,7 +65,7 @@
this.containerAccess.a((world, blockposition) -> { this.containerAccess.a((world, blockposition) -> {
int i = 0; int i = 0;
@@ -135,12 +164,47 @@ @@ -135,12 +163,47 @@
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) list.get(this.h.nextInt(list.size())); WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) list.get(this.h.nextInt(list.size()));
@ -115,7 +114,7 @@
this.c(); this.c();
}); });
} else { } else {
@@ -167,9 +231,24 @@ @@ -167,9 +230,24 @@
ItemStack itemstack2 = itemstack; ItemStack itemstack2 = itemstack;
List<WeightedRandomEnchant> list = this.a(itemstack, i, this.costs[i]); List<WeightedRandomEnchant> list = this.a(itemstack, i, this.costs[i]);
@ -142,7 +141,7 @@
if (flag) { if (flag) {
itemstack2 = new ItemStack(Items.ENCHANTED_BOOK); itemstack2 = new ItemStack(Items.ENCHANTED_BOOK);
@@ -182,16 +261,29 @@ @@ -182,16 +260,29 @@
this.enchantSlots.setItem(0, itemstack2); this.enchantSlots.setItem(0, itemstack2);
} }
@ -178,7 +177,7 @@
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1.subtract(j); itemstack1.subtract(j);
if (itemstack1.isEmpty()) { if (itemstack1.isEmpty()) {
@@ -238,6 +330,7 @@ @@ -238,6 +329,7 @@
@Override @Override
public boolean canUse(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
@ -186,7 +185,7 @@
return a(this.containerAccess, entityhuman, Blocks.ENCHANTING_TABLE); return a(this.containerAccess, entityhuman, Blocks.ENCHANTING_TABLE);
} }
@@ -289,4 +382,17 @@ @@ -289,4 +381,17 @@
return itemstack; return itemstack;
} }

View File

@ -1,16 +1,16 @@
--- a/net/minecraft/server/ContainerGrindstone.java --- a/net/minecraft/server/ContainerGrindstone.java
+++ b/net/minecraft/server/ContainerGrindstone.java +++ b/net/minecraft/server/ContainerGrindstone.java
@@ -4,9 +4,30 @@ @@ -5,8 +5,30 @@
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.stream.Collectors; import java.util.stream.Collectors;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.craftbukkit.inventory.CraftInventoryGrindstone; +import org.bukkit.craftbukkit.inventory.CraftInventoryGrindstone;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; +import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+import org.bukkit.entity.Player; +import org.bukkit.entity.Player;
+// CraftBukkit end +// CraftBukkit end
+
public class ContainerGrindstone extends Container { public class ContainerGrindstone extends Container {
+ // CraftBukkit start + // CraftBukkit start
@ -31,7 +31,7 @@
private final IInventory resultInventory; private final IInventory resultInventory;
private final IInventory craftInventory; private final IInventory craftInventory;
private final ContainerAccess containerAccess; private final ContainerAccess containerAccess;
@@ -24,6 +45,13 @@ @@ -24,6 +46,13 @@
super.update(); super.update();
ContainerGrindstone.this.a((IInventory) this); ContainerGrindstone.this.a((IInventory) this);
} }
@ -45,7 +45,7 @@
}; };
this.containerAccess = containeraccess; this.containerAccess = containeraccess;
this.a(new Slot(this.craftInventory, 0, 49, 19) { this.a(new Slot(this.craftInventory, 0, 49, 19) {
@@ -108,6 +136,7 @@ @@ -108,6 +137,7 @@
this.a(new Slot(playerinventory, j, 8 + j * 18, 142)); this.a(new Slot(playerinventory, j, 8 + j * 18, 142));
} }
@ -53,7 +53,7 @@
} }
@Override @Override
@@ -235,6 +264,7 @@ @@ -235,6 +265,7 @@
@Override @Override
public boolean canUse(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {

View File

@ -1,19 +1,20 @@
--- a/net/minecraft/server/ContainerStonecutter.java --- a/net/minecraft/server/ContainerStonecutter.java
+++ b/net/minecraft/server/ContainerStonecutter.java +++ b/net/minecraft/server/ContainerStonecutter.java
@@ -2,6 +2,12 @@ @@ -3,6 +3,13 @@
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import java.util.List; import java.util.List;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.craftbukkit.inventory.CraftInventoryStonecutter; +import org.bukkit.craftbukkit.inventory.CraftInventoryStonecutter;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; +import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+import org.bukkit.entity.Player; +import org.bukkit.entity.Player;
+// CraftBukkit end +// CraftBukkit end
+
public class ContainerStonecutter extends Container { public class ContainerStonecutter extends Container {
@@ -16,6 +22,21 @@ private final ContainerAccess containerAccess;
@@ -16,6 +23,21 @@
private Runnable l; private Runnable l;
public final IInventory inventory; public final IInventory inventory;
private final InventoryCraftResult resultInventory; private final InventoryCraftResult resultInventory;
@ -35,7 +36,7 @@
public ContainerStonecutter(int i, PlayerInventory playerinventory) { public ContainerStonecutter(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a); this(i, playerinventory, ContainerAccess.a);
@@ -35,6 +56,13 @@ @@ -35,6 +57,13 @@
ContainerStonecutter.this.a((IInventory) this); ContainerStonecutter.this.a((IInventory) this);
ContainerStonecutter.this.l.run(); ContainerStonecutter.this.l.run();
} }
@ -49,7 +50,7 @@
}; };
this.resultInventory = new InventoryCraftResult(); this.resultInventory = new InventoryCraftResult();
this.containerAccess = containeraccess; this.containerAccess = containeraccess;
@@ -82,10 +110,12 @@ @@ -82,10 +111,12 @@
} }
this.a(this.containerProperty); this.a(this.containerProperty);

View File

@ -1,17 +1,17 @@
--- a/net/minecraft/server/ContainerWorkbench.java --- a/net/minecraft/server/ContainerWorkbench.java
+++ b/net/minecraft/server/ContainerWorkbench.java +++ b/net/minecraft/server/ContainerWorkbench.java
@@ -1,6 +1,10 @@ @@ -2,12 +2,21 @@
package net.minecraft.server;
import java.util.Optional; import java.util.Optional;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting; +import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; +import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end +// CraftBukkit end
+
public class ContainerWorkbench extends ContainerRecipeBook<InventoryCrafting> { public class ContainerWorkbench extends ContainerRecipeBook<InventoryCrafting> {
@@ -8,6 +12,10 @@ private final InventoryCrafting craftInventory;
private final InventoryCraftResult resultInventory; private final InventoryCraftResult resultInventory;
public final ContainerAccess containerAccess; public final ContainerAccess containerAccess;
private final EntityHuman f; private final EntityHuman f;
@ -22,7 +22,7 @@
public ContainerWorkbench(int i, PlayerInventory playerinventory) { public ContainerWorkbench(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a); this(i, playerinventory, ContainerAccess.a);
@@ -15,8 +23,12 @@ @@ -15,8 +24,12 @@
public ContainerWorkbench(int i, PlayerInventory playerinventory, ContainerAccess containeraccess) { public ContainerWorkbench(int i, PlayerInventory playerinventory, ContainerAccess containeraccess) {
super(Containers.CRAFTING, i); super(Containers.CRAFTING, i);
@ -36,7 +36,7 @@
this.containerAccess = containeraccess; this.containerAccess = containeraccess;
this.f = playerinventory.player; this.f = playerinventory.player;
this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 124, 35))); this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 124, 35)));
@@ -42,7 +54,7 @@ @@ -42,7 +55,7 @@
} }
@ -45,7 +45,7 @@
if (!world.isClientSide) { if (!world.isClientSide) {
EntityPlayer entityplayer = (EntityPlayer) entityhuman; EntityPlayer entityplayer = (EntityPlayer) entityhuman;
ItemStack itemstack = ItemStack.b; ItemStack itemstack = ItemStack.b;
@@ -55,6 +67,7 @@ @@ -55,6 +68,7 @@
itemstack = recipecrafting.a(inventorycrafting); itemstack = recipecrafting.a(inventorycrafting);
} }
} }
@ -53,7 +53,7 @@
inventorycraftresult.setItem(0, itemstack); inventorycraftresult.setItem(0, itemstack);
entityplayer.playerConnection.sendPacket(new PacketPlayOutSetSlot(i, 0, itemstack)); entityplayer.playerConnection.sendPacket(new PacketPlayOutSetSlot(i, 0, itemstack));
@@ -64,7 +77,7 @@ @@ -64,7 +78,7 @@
@Override @Override
public void a(IInventory iinventory) { public void a(IInventory iinventory) {
this.containerAccess.a((world, blockposition) -> { this.containerAccess.a((world, blockposition) -> {
@ -62,7 +62,7 @@
}); });
} }
@@ -94,6 +107,7 @@ @@ -94,6 +108,7 @@
@Override @Override
public boolean canUse(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
@ -70,7 +70,7 @@
return a(this.containerAccess, entityhuman, Blocks.CRAFTING_TABLE); return a(this.containerAccess, entityhuman, Blocks.CRAFTING_TABLE);
} }
@@ -168,4 +182,17 @@ @@ -168,4 +183,17 @@
public int h() { public int h() {
return this.craftInventory.f(); return this.craftInventory.f();
} }

View File

@ -1,18 +1,21 @@
--- a/net/minecraft/server/DedicatedServerProperties.java --- a/net/minecraft/server/DedicatedServerProperties.java
+++ b/net/minecraft/server/DedicatedServerProperties.java +++ b/net/minecraft/server/DedicatedServerProperties.java
@@ -2,9 +2,11 @@ @@ -3,8 +3,14 @@
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
+import joptsimple.OptionSet; // CraftBukkit
+// CraftBukkit start
+import joptsimple.OptionSet;
+import net.minecraft.server.PropertyManager.EditableProperty;
+// CraftBukkit end
+
public class DedicatedServerProperties extends PropertyManager<DedicatedServerProperties> { public class DedicatedServerProperties extends PropertyManager<DedicatedServerProperties> {
+ public final boolean debug = this.getBoolean("debug", false); // CraftBukkit + public final boolean debug = this.getBoolean("debug", false); // CraftBukkit
public final boolean onlineMode = this.getBoolean("online-mode", true); public final boolean onlineMode = this.getBoolean("online-mode", true);
public final boolean preventProxyConnections = this.getBoolean("prevent-proxy-connections", false); public final boolean preventProxyConnections = this.getBoolean("prevent-proxy-connections", false);
public final String serverIp = this.getString("server-ip", ""); public final String serverIp = this.getString("server-ip", "");
@@ -55,8 +57,10 @@ @@ -55,8 +61,10 @@
public final PropertyManager<DedicatedServerProperties>.EditableProperty<Boolean> whiteList; public final PropertyManager<DedicatedServerProperties>.EditableProperty<Boolean> whiteList;
public final GeneratorSettings generatorSettings; public final GeneratorSettings generatorSettings;
@ -25,7 +28,7 @@
this.difficulty = (EnumDifficulty) this.a("difficulty", a(EnumDifficulty::getById, EnumDifficulty::a), EnumDifficulty::c, EnumDifficulty.EASY); this.difficulty = (EnumDifficulty) this.a("difficulty", a(EnumDifficulty::getById, EnumDifficulty::a), EnumDifficulty::c, EnumDifficulty.EASY);
this.gamemode = (EnumGamemode) this.a("gamemode", a(EnumGamemode::getById, EnumGamemode::a), EnumGamemode::b, EnumGamemode.SURVIVAL); this.gamemode = (EnumGamemode) this.a("gamemode", a(EnumGamemode::getById, EnumGamemode::a), EnumGamemode::b, EnumGamemode.SURVIVAL);
this.levelName = this.getString("level-name", "world"); this.levelName = this.getString("level-name", "world");
@@ -107,12 +111,14 @@ @@ -107,12 +115,14 @@
this.generatorSettings = GeneratorSettings.a(iregistrycustom, properties); this.generatorSettings = GeneratorSettings.a(iregistrycustom, properties);
} }

View File

@ -1,14 +1,14 @@
--- a/net/minecraft/server/DedicatedServerSettings.java --- a/net/minecraft/server/DedicatedServerSettings.java
+++ b/net/minecraft/server/DedicatedServerSettings.java +++ b/net/minecraft/server/DedicatedServerSettings.java
@@ -1,15 +1,21 @@ @@ -2,14 +2,21 @@
package net.minecraft.server;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
+// CraftBukkit start +// CraftBukkit start
+import java.io.File; +import java.io.File;
+import joptsimple.OptionSet; +import joptsimple.OptionSet;
+// CraftBukkit end +// CraftBukkit end
+
public class DedicatedServerSettings { public class DedicatedServerSettings {
private final java.nio.file.Path path; private final java.nio.file.Path path;

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/DispenseBehaviorShears.java --- a/net/minecraft/server/DispenseBehaviorShears.java
+++ b/net/minecraft/server/DispenseBehaviorShears.java +++ b/net/minecraft/server/DispenseBehaviorShears.java
@@ -2,6 +2,11 @@ @@ -3,6 +3,12 @@
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.block.BlockDispenseEvent; +import org.bukkit.event.block.BlockDispenseEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class DispenseBehaviorShears extends DispenseBehaviorMaybe { public class DispenseBehaviorShears extends DispenseBehaviorMaybe {
@@ -10,11 +15,34 @@ public DispenseBehaviorShears() {}
@@ -10,11 +16,34 @@
@Override @Override
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
WorldServer worldserver = isourceblock.getWorld(); WorldServer worldserver = isourceblock.getWorld();
@ -48,7 +49,7 @@
if (this.a() && itemstack.isDamaged(1, worldserver.getRandom(), (EntityPlayer) null)) { if (this.a() && itemstack.isDamaged(1, worldserver.getRandom(), (EntityPlayer) null)) {
itemstack.setCount(0); itemstack.setCount(0);
} }
@@ -40,7 +68,7 @@ @@ -40,7 +69,7 @@
return false; return false;
} }
@ -57,7 +58,7 @@
List<EntityLiving> list = worldserver.a(EntityLiving.class, new AxisAlignedBB(blockposition), IEntitySelector.g); List<EntityLiving> list = worldserver.a(EntityLiving.class, new AxisAlignedBB(blockposition), IEntitySelector.g);
Iterator iterator = list.iterator(); Iterator iterator = list.iterator();
@@ -51,6 +79,11 @@ @@ -51,6 +80,11 @@
IShearable ishearable = (IShearable) entityliving; IShearable ishearable = (IShearable) entityliving;
if (ishearable.canShear()) { if (ishearable.canShear()) {

View File

@ -1,23 +1,6 @@
--- a/net/minecraft/server/DispenserRegistry.java --- a/net/minecraft/server/DispenserRegistry.java
+++ b/net/minecraft/server/DispenserRegistry.java +++ b/net/minecraft/server/DispenserRegistry.java
@@ -7,6 +7,16 @@ @@ -31,6 +31,69 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.List;
+import org.bukkit.Location;
+import org.bukkit.TreeType;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
+import org.bukkit.event.block.BlockDispenseEvent;
+import org.bukkit.event.world.StructureGrowEvent;
+// CraftBukkit end
+
public class DispenserRegistry {
public static final PrintStream a = System.out;
@@ -31,6 +41,69 @@
TagStatic.b(); TagStatic.b();
d(); d();
} }

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/DragonControllerManager.java --- a/net/minecraft/server/DragonControllerManager.java
+++ b/net/minecraft/server/DragonControllerManager.java +++ b/net/minecraft/server/DragonControllerManager.java
@@ -2,6 +2,10 @@ @@ -3,6 +3,11 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftEnderDragon; +import org.bukkit.craftbukkit.entity.CraftEnderDragon;
+import org.bukkit.event.entity.EnderDragonChangePhaseEvent; +import org.bukkit.event.entity.EnderDragonChangePhaseEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class DragonControllerManager { public class DragonControllerManager {
@@ -21,6 +25,19 @@ private static final Logger LOGGER = LogManager.getLogger();
@@ -21,6 +26,19 @@
this.currentDragonController.e(); this.currentDragonController.e();
} }
@ -31,7 +32,7 @@
this.currentDragonController = this.b(dragoncontrollerphase); this.currentDragonController = this.b(dragoncontrollerphase);
if (!this.enderDragon.world.isClientSide) { if (!this.enderDragon.world.isClientSide) {
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, dragoncontrollerphase.b()); this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, dragoncontrollerphase.b());
@@ -42,6 +59,6 @@ @@ -42,6 +60,6 @@
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon); this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
} }

View File

@ -1,17 +1,6 @@
--- a/net/minecraft/server/EnchantmentFrostWalker.java --- a/net/minecraft/server/EnchantmentFrostWalker.java
+++ b/net/minecraft/server/EnchantmentFrostWalker.java +++ b/net/minecraft/server/EnchantmentFrostWalker.java
@@ -1,6 +1,10 @@ @@ -46,8 +46,11 @@
package net.minecraft.server;
import java.util.Iterator;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.event.block.EntityBlockFormEvent;
+// CraftBukkit end
public class EnchantmentFrostWalker extends Enchantment {
@@ -46,8 +50,11 @@
IBlockData iblockdata2 = world.getType(blockposition1); IBlockData iblockdata2 = world.getType(blockposition1);
if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) { if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) {

View File

@ -1,14 +1,14 @@
--- a/net/minecraft/server/EntityAnimal.java --- a/net/minecraft/server/EntityAnimal.java
+++ b/net/minecraft/server/EntityAnimal.java +++ b/net/minecraft/server/EntityAnimal.java
@@ -3,11 +3,16 @@ @@ -4,10 +4,16 @@
import java.util.Random;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityEnterLoveModeEvent; +import org.bukkit.event.entity.EntityEnterLoveModeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public abstract class EntityAnimal extends EntityAgeable { public abstract class EntityAnimal extends EntityAgeable {
public int loveTicks; public int loveTicks;
@ -17,7 +17,7 @@
protected EntityAnimal(EntityTypes<? extends EntityAnimal> entitytypes, World world) { protected EntityAnimal(EntityTypes<? extends EntityAnimal> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
@@ -44,6 +49,9 @@ @@ -44,6 +50,9 @@
} }
@ -27,7 +27,7 @@
@Override @Override
public boolean damageEntity(DamageSource damagesource, float f) { public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable(damagesource)) { if (this.isInvulnerable(damagesource)) {
@@ -53,6 +61,7 @@ @@ -53,6 +62,7 @@
return super.damageEntity(damagesource, f); return super.damageEntity(damagesource, f);
} }
} }
@ -35,7 +35,7 @@
@Override @Override
public float a(BlockPosition blockposition, IWorldReader iworldreader) { public float a(BlockPosition blockposition, IWorldReader iworldreader) {
@@ -143,10 +152,17 @@ @@ -143,10 +153,17 @@
} }
public void g(@Nullable EntityHuman entityhuman) { public void g(@Nullable EntityHuman entityhuman) {
@ -54,7 +54,7 @@
this.world.broadcastEntityEffect(this, (byte) 18); this.world.broadcastEntityEffect(this, (byte) 18);
} }
@@ -186,11 +202,24 @@ @@ -186,11 +203,24 @@
EntityAgeable entityageable = this.createChild(worldserver, entityanimal); EntityAgeable entityageable = this.createChild(worldserver, entityanimal);
if (entityageable != null) { if (entityageable != null) {
@ -79,7 +79,7 @@
if (entityplayer != null) { if (entityplayer != null) {
entityplayer.a(StatisticList.ANIMALS_BRED); entityplayer.a(StatisticList.ANIMALS_BRED);
@@ -203,10 +232,14 @@ @@ -203,10 +233,14 @@
entityanimal.resetLove(); entityanimal.resetLove();
entityageable.setBaby(true); entityageable.setBaby(true);
entityageable.setPositionRotation(this.locX(), this.locY(), this.locZ(), 0.0F, 0.0F); entityageable.setPositionRotation(this.locX(), this.locY(), this.locZ(), 0.0F, 0.0F);

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/EntityAreaEffectCloud.java --- a/net/minecraft/server/EntityAreaEffectCloud.java
+++ b/net/minecraft/server/EntityAreaEffectCloud.java +++ b/net/minecraft/server/EntityAreaEffectCloud.java
@@ -13,6 +13,10 @@ @@ -14,6 +14,11 @@
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.LivingEntity;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityAreaEffectCloud extends Entity { public class EntityAreaEffectCloud extends Entity {
@@ -105,6 +109,22 @@ private static final Logger LOGGER = LogManager.getLogger();
@@ -105,6 +110,22 @@
} }
@ -34,7 +35,7 @@
public int getColor() { public int getColor() {
return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.COLOR); return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.COLOR);
} }
@@ -249,6 +269,7 @@ @@ -249,6 +270,7 @@
if (!list1.isEmpty()) { if (!list1.isEmpty()) {
Iterator iterator2 = list1.iterator(); Iterator iterator2 = list1.iterator();
@ -42,7 +43,7 @@
while (iterator2.hasNext()) { while (iterator2.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator2.next(); EntityLiving entityliving = (EntityLiving) iterator2.next();
@@ -258,6 +279,17 @@ @@ -258,6 +280,17 @@
double d2 = d0 * d0 + d1 * d1; double d2 = d0 * d0 + d1 * d1;
if (d2 <= (double) (f * f)) { if (d2 <= (double) (f * f)) {
@ -60,7 +61,7 @@
this.affectedEntities.put(entityliving, this.ticksLived + this.reapplicationDelay); this.affectedEntities.put(entityliving, this.ticksLived + this.reapplicationDelay);
Iterator iterator3 = list.iterator(); Iterator iterator3 = list.iterator();
@@ -267,7 +299,7 @@ @@ -267,7 +300,7 @@
if (mobeffect1.getMobEffect().isInstant()) { if (mobeffect1.getMobEffect().isInstant()) {
mobeffect1.getMobEffect().applyInstantEffect(this, this.getSource(), entityliving, mobeffect1.getAmplifier(), 0.5D); mobeffect1.getMobEffect().applyInstantEffect(this, this.getSource(), entityliving, mobeffect1.getAmplifier(), 0.5D);
} else { } else {

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/EntityBat.java --- a/net/minecraft/server/EntityBat.java
+++ b/net/minecraft/server/EntityBat.java +++ b/net/minecraft/server/EntityBat.java
@@ -4,6 +4,7 @@ @@ -5,6 +5,8 @@
import java.time.temporal.ChronoField;
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class EntityBat extends EntityAmbient { public class EntityBat extends EntityAmbient {
@@ -105,16 +106,24 @@ private static final DataWatcherObject<Byte> b = DataWatcher.a(EntityBat.class, DataWatcherRegistry.a);
@@ -105,16 +107,24 @@
} }
if (this.world.a(EntityBat.c, (EntityLiving) this) != null) { if (this.world.a(EntityBat.c, (EntityLiving) this) != null) {
@ -38,7 +39,7 @@
} }
} else { } else {
if (this.d != null && (!this.world.isEmpty(this.d) || this.d.getY() < 1)) { if (this.d != null && (!this.world.isEmpty(this.d) || this.d.getY() < 1)) {
@@ -138,7 +147,11 @@ @@ -138,7 +148,11 @@
this.aT = 0.5F; this.aT = 0.5F;
this.yaw += f1; this.yaw += f1;
if (this.random.nextInt(100) == 0 && this.world.getType(blockposition1).isOccluding(this.world, blockposition1)) { if (this.random.nextInt(100) == 0 && this.world.getType(blockposition1).isOccluding(this.world, blockposition1)) {
@ -51,7 +52,7 @@
} }
} }
@@ -168,7 +181,11 @@ @@ -168,7 +182,11 @@
return false; return false;
} else { } else {
if (!this.world.isClientSide && this.isAsleep()) { if (!this.world.isClientSide && this.isAsleep()) {

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/EntityCreeper.java --- a/net/minecraft/server/EntityCreeper.java
+++ b/net/minecraft/server/EntityCreeper.java +++ b/net/minecraft/server/EntityCreeper.java
@@ -2,6 +2,11 @@ @@ -3,6 +3,12 @@
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.ExplosionPrimeEvent; +import org.bukkit.event.entity.ExplosionPrimeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityCreeper extends EntityMonster { public class EntityCreeper extends EntityMonster {
@@ -165,9 +170,19 @@ private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.b);
@@ -165,9 +171,19 @@
@Override @Override
public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) { public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) {
super.onLightningStrike(worldserver, entitylightning); super.onLightningStrike(worldserver, entitylightning);
@ -33,7 +34,7 @@
@Override @Override
protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) { protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) {
ItemStack itemstack = entityhuman.b(enumhand); ItemStack itemstack = entityhuman.b(enumhand);
@@ -192,10 +207,18 @@ @@ -192,10 +208,18 @@
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
float f = this.isPowered() ? 2.0F : 1.0F; float f = this.isPowered() ? 2.0F : 1.0F;
@ -56,7 +57,7 @@
} }
} }
@@ -206,6 +229,7 @@ @@ -206,6 +230,7 @@
if (!collection.isEmpty()) { if (!collection.isEmpty()) {
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX(), this.locY(), this.locZ()); EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX(), this.locY(), this.locZ());
@ -64,7 +65,7 @@
entityareaeffectcloud.setRadius(2.5F); entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F); entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10); entityareaeffectcloud.setWaitTime(10);
@@ -219,7 +243,7 @@ @@ -219,7 +244,7 @@
entityareaeffectcloud.addEffect(new MobEffect(mobeffect)); entityareaeffectcloud.addEffect(new MobEffect(mobeffect));
} }

View File

@ -1,16 +1,15 @@
--- a/net/minecraft/server/EntityEnderDragon.java --- a/net/minecraft/server/EntityEnderDragon.java
+++ b/net/minecraft/server/EntityEnderDragon.java +++ b/net/minecraft/server/EntityEnderDragon.java
@@ -6,7 +6,13 @@ @@ -7,6 +7,12 @@
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.event.entity.EntityRegainHealthEvent; +import org.bukkit.event.entity.EntityRegainHealthEvent;
+// CraftBukkit end +// CraftBukkit end
+
+// PAIL: Fixme
public class EntityEnderDragon extends EntityInsentient implements IMonster { public class EntityEnderDragon extends EntityInsentient implements IMonster {
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();

View File

@ -1,19 +1,20 @@
--- a/net/minecraft/server/EntityEnderPearl.java --- a/net/minecraft/server/EntityEnderPearl.java
+++ b/net/minecraft/server/EntityEnderPearl.java +++ b/net/minecraft/server/EntityEnderPearl.java
@@ -1,6 +1,12 @@ @@ -2,6 +2,13 @@
package net.minecraft.server;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerTeleportEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityEnderPearl extends EntityProjectileThrowable { public class EntityEnderPearl extends EntityProjectileThrowable {
@@ -37,21 +43,35 @@ public EntityEnderPearl(EntityTypes<? extends EntityEnderPearl> entitytypes, World world) {
@@ -37,21 +44,35 @@
EntityPlayer entityplayer = (EntityPlayer) entity; EntityPlayer entityplayer = (EntityPlayer) entity;
if (entityplayer.playerConnection.a().isConnected() && entityplayer.world == this.world && !entityplayer.isSleeping()) { if (entityplayer.playerConnection.a().isConnected() && entityplayer.world == this.world && !entityplayer.isSleeping()) {
@ -60,7 +61,7 @@
} }
} else if (entity != null) { } else if (entity != null) {
entity.enderTeleportTo(this.locX(), this.locY(), this.locZ()); entity.enderTeleportTo(this.locX(), this.locY(), this.locZ());
@@ -80,7 +100,7 @@ @@ -80,7 +101,7 @@
public Entity b(WorldServer worldserver) { public Entity b(WorldServer worldserver) {
Entity entity = this.getShooter(); Entity entity = this.getShooter();

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/EntityExperienceOrb.java --- a/net/minecraft/server/EntityExperienceOrb.java
+++ b/net/minecraft/server/EntityExperienceOrb.java +++ b/net/minecraft/server/EntityExperienceOrb.java
@@ -1,6 +1,11 @@ @@ -2,6 +2,12 @@
package net.minecraft.server;
import java.util.Map.Entry; import java.util.Map.Entry;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetLivingEntityEvent; +import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
+import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityExperienceOrb extends Entity { public class EntityExperienceOrb extends Entity {
@@ -36,6 +41,7 @@ public int b;
@@ -36,6 +42,7 @@
@Override @Override
public void tick() { public void tick() {
super.tick(); super.tick();
@ -20,7 +21,7 @@
if (this.d > 0) { if (this.d > 0) {
--this.d; --this.d;
} }
@@ -72,7 +78,22 @@ @@ -72,7 +79,22 @@
this.targetPlayer = null; this.targetPlayer = null;
} }
@ -44,7 +45,7 @@
Vec3D vec3d = new Vec3D(this.targetPlayer.locX() - this.locX(), this.targetPlayer.locY() + (double) this.targetPlayer.getHeadHeight() / 2.0D - this.locY(), this.targetPlayer.locZ() - this.locZ()); Vec3D vec3d = new Vec3D(this.targetPlayer.locX() - this.locX(), this.targetPlayer.locY() + (double) this.targetPlayer.getHeadHeight() / 2.0D - this.locY(), this.targetPlayer.locZ() - this.locZ());
double d1 = vec3d.g(); double d1 = vec3d.g();
@@ -155,13 +176,19 @@ @@ -155,13 +177,19 @@
if (!itemstack.isEmpty() && itemstack.f()) { if (!itemstack.isEmpty() && itemstack.f()) {
int i = Math.min(this.c(this.value), itemstack.getDamage()); int i = Math.min(this.c(this.value), itemstack.getDamage());
@ -67,7 +68,7 @@
} }
this.die(); this.die();
@@ -183,6 +210,24 @@ @@ -183,6 +211,24 @@
} }
public static int getOrbValue(int i) { public static int getOrbValue(int i) {

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/EntityFireworks.java --- a/net/minecraft/server/EntityFireworks.java
+++ b/net/minecraft/server/EntityFireworks.java +++ b/net/minecraft/server/EntityFireworks.java
@@ -4,6 +4,7 @@ @@ -5,6 +5,8 @@
import java.util.List;
import java.util.OptionalInt; import java.util.OptionalInt;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class EntityFireworks extends IProjectile { public class EntityFireworks extends IProjectile {
@@ -121,7 +122,11 @@ public static final DataWatcherObject<ItemStack> FIREWORK_ITEM = DataWatcher.a(EntityFireworks.class, DataWatcherRegistry.g);
@@ -121,7 +123,11 @@
} }
if (!this.world.isClientSide && this.ticksFlown > this.expectedLifespan) { if (!this.world.isClientSide && this.ticksFlown > this.expectedLifespan) {
@ -21,7 +22,7 @@
} }
} }
@@ -136,7 +141,11 @@ @@ -136,7 +142,11 @@
protected void a(MovingObjectPositionEntity movingobjectpositionentity) { protected void a(MovingObjectPositionEntity movingobjectpositionentity) {
super.a(movingobjectpositionentity); super.a(movingobjectpositionentity);
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -34,7 +35,7 @@
} }
} }
@@ -146,7 +155,11 @@ @@ -146,7 +156,11 @@
this.world.getType(blockposition).a(this.world, blockposition, (Entity) this); this.world.getType(blockposition).a(this.world, blockposition, (Entity) this);
if (!this.world.s_() && this.hasExplosions()) { if (!this.world.s_() && this.hasExplosions()) {
@ -47,7 +48,7 @@
} }
super.a(movingobjectpositionblock); super.a(movingobjectpositionblock);
@@ -172,7 +185,9 @@ @@ -172,7 +186,9 @@
if (f > 0.0F) { if (f > 0.0F) {
if (this.ridingEntity != null) { if (this.ridingEntity != null) {
@ -57,7 +58,7 @@
} }
double d0 = 5.0D; double d0 = 5.0D;
@@ -199,7 +214,9 @@ @@ -199,7 +215,9 @@
if (flag) { if (flag) {
float f1 = f * (float) Math.sqrt((5.0D - (double) this.g((Entity) entityliving)) / 5.0D); float f1 = f * (float) Math.sqrt((5.0D - (double) this.g((Entity) entityliving)) / 5.0D);

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/EntityFishingHook.java --- a/net/minecraft/server/EntityFishingHook.java
+++ b/net/minecraft/server/EntityFishingHook.java +++ b/net/minecraft/server/EntityFishingHook.java
@@ -6,6 +6,11 @@ @@ -7,6 +7,12 @@
import java.util.List;
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.entity.Player; +import org.bukkit.entity.Player;
+import org.bukkit.entity.FishHook; +import org.bukkit.entity.FishHook;
+import org.bukkit.event.player.PlayerFishEvent; +import org.bukkit.event.player.PlayerFishEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityFishingHook extends IProjectile { public class EntityFishingHook extends IProjectile {
@@ -25,6 +30,12 @@ private final Random b;
@@ -25,6 +31,12 @@
private final int an; private final int an;
private final int lureLevel; private final int lureLevel;
@ -25,7 +26,7 @@
private EntityFishingHook(World world, EntityHuman entityhuman, int i, int j) { private EntityFishingHook(World world, EntityHuman entityhuman, int i, int j) {
super(EntityTypes.FISHING_BOBBER, world); super(EntityTypes.FISHING_BOBBER, world);
this.b = new Random(); this.b = new Random();
@@ -253,6 +264,10 @@ @@ -253,6 +265,10 @@
this.waitTime = 0; this.waitTime = 0;
this.ai = 0; this.ai = 0;
this.getDataWatcher().set(EntityFishingHook.f, false); this.getDataWatcher().set(EntityFishingHook.f, false);
@ -36,7 +37,7 @@
} }
} else { } else {
float f; float f;
@@ -286,6 +301,13 @@ @@ -286,6 +302,13 @@
worldserver.a(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D); worldserver.a(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D);
} }
} else { } else {
@ -50,7 +51,7 @@
this.playSound(SoundEffects.ENTITY_FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); this.playSound(SoundEffects.ENTITY_FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
double d3 = this.locY() + 0.5D; double d3 = this.locY() + 0.5D;
@@ -322,8 +344,10 @@ @@ -322,8 +345,10 @@
this.ai = MathHelper.nextInt(this.random, 20, 80); this.ai = MathHelper.nextInt(this.random, 20, 80);
} }
} else { } else {
@ -63,7 +64,7 @@
} }
} }
@@ -390,6 +414,14 @@ @@ -390,6 +415,14 @@
int i = 0; int i = 0;
if (this.hooked != null) { if (this.hooked != null) {
@ -78,7 +79,7 @@
this.reel(); this.reel();
CriterionTriggers.D.a((EntityPlayer) entityhuman, itemstack, this, (Collection) Collections.emptyList()); CriterionTriggers.D.a((EntityPlayer) entityhuman, itemstack, this, (Collection) Collections.emptyList());
this.world.broadcastEntityEffect(this, (byte) 31); this.world.broadcastEntityEffect(this, (byte) 31);
@@ -405,6 +437,15 @@ @@ -405,6 +438,15 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
ItemStack itemstack1 = (ItemStack) iterator.next(); ItemStack itemstack1 = (ItemStack) iterator.next();
EntityItem entityitem = new EntityItem(this.world, this.locX(), this.locY(), this.locZ(), itemstack1); EntityItem entityitem = new EntityItem(this.world, this.locX(), this.locY(), this.locZ(), itemstack1);
@ -94,7 +95,7 @@
double d0 = entityhuman.locX() - this.locX(); double d0 = entityhuman.locX() - this.locX();
double d1 = entityhuman.locY() - this.locY(); double d1 = entityhuman.locY() - this.locY();
double d2 = entityhuman.locZ() - this.locZ(); double d2 = entityhuman.locZ() - this.locZ();
@@ -412,7 +453,11 @@ @@ -412,7 +454,11 @@
entityitem.setMot(d0 * 0.1D, d1 * 0.1D + Math.sqrt(Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2)) * 0.08D, d2 * 0.1D); entityitem.setMot(d0 * 0.1D, d1 * 0.1D + Math.sqrt(Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2)) * 0.08D, d2 * 0.1D);
this.world.addEntity(entityitem); this.world.addEntity(entityitem);
@ -107,7 +108,7 @@
if (itemstack1.getItem().a((Tag) TagsItem.FISHES)) { if (itemstack1.getItem().a((Tag) TagsItem.FISHES)) {
entityhuman.a(StatisticList.FISH_CAUGHT, 1); entityhuman.a(StatisticList.FISH_CAUGHT, 1);
} }
@@ -422,8 +467,25 @@ @@ -422,8 +468,25 @@
} }
if (this.onGround) { if (this.onGround) {

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/EntityHorseAbstract.java --- a/net/minecraft/server/EntityHorseAbstract.java
+++ b/net/minecraft/server/EntityHorseAbstract.java +++ b/net/minecraft/server/EntityHorseAbstract.java
@@ -6,6 +6,7 @@ @@ -7,6 +7,8 @@
import java.util.UUID;
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
+import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
+
public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, IJumpable, ISaddleable { public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, IJumpable, ISaddleable {
@@ -34,6 +35,7 @@ private static final Predicate<EntityLiving> bw = (entityliving) -> {
@@ -34,6 +36,7 @@
private float bK; private float bK;
protected boolean bu = true; protected boolean bu = true;
protected int bv; protected int bv;
@ -16,7 +17,7 @@
protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) { protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
@@ -218,7 +220,7 @@ @@ -218,7 +221,7 @@
public void loadChest() { public void loadChest() {
InventorySubcontainer inventorysubcontainer = this.inventoryChest; InventorySubcontainer inventorysubcontainer = this.inventoryChest;
@ -25,7 +26,7 @@
if (inventorysubcontainer != null) { if (inventorysubcontainer != null) {
inventorysubcontainer.b((IInventoryListener) this); inventorysubcontainer.b((IInventoryListener) this);
int i = Math.min(inventorysubcontainer.getSize(), this.inventoryChest.getSize()); int i = Math.min(inventorysubcontainer.getSize(), this.inventoryChest.getSize());
@@ -334,7 +336,7 @@ @@ -334,7 +337,7 @@
} }
public int getMaxDomestication() { public int getMaxDomestication() {
@ -34,7 +35,7 @@
} }
@Override @Override
@@ -405,7 +407,7 @@ @@ -405,7 +408,7 @@
} }
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) { if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
@ -43,7 +44,7 @@
flag = true; flag = true;
} }
@@ -481,7 +483,7 @@ @@ -481,7 +484,7 @@
super.movementTick(); super.movementTick();
if (!this.world.isClientSide && this.isAlive()) { if (!this.world.isClientSide && this.isAlive()) {
if (this.random.nextInt(900) == 0 && this.deathTicks == 0) { if (this.random.nextInt(900) == 0 && this.deathTicks == 0) {
@ -52,7 +53,7 @@
} }
if (this.fl()) { if (this.fl()) {
@@ -718,6 +720,7 @@ @@ -718,6 +721,7 @@
if (this.getOwnerUUID() != null) { if (this.getOwnerUUID() != null) {
nbttagcompound.a("Owner", this.getOwnerUUID()); nbttagcompound.a("Owner", this.getOwnerUUID());
} }
@ -60,7 +61,7 @@
if (!this.inventoryChest.getItem(0).isEmpty()) { if (!this.inventoryChest.getItem(0).isEmpty()) {
nbttagcompound.set("SaddleItem", this.inventoryChest.getItem(0).save(new NBTTagCompound())); nbttagcompound.set("SaddleItem", this.inventoryChest.getItem(0).save(new NBTTagCompound()));
@@ -745,6 +748,11 @@ @@ -745,6 +749,11 @@
if (uuid != null) { if (uuid != null) {
this.setOwnerUUID(uuid); this.setOwnerUUID(uuid);
} }
@ -72,7 +73,7 @@
if (nbttagcompound.hasKeyOfType("SaddleItem", 10)) { if (nbttagcompound.hasKeyOfType("SaddleItem", 10)) {
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("SaddleItem")); ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("SaddleItem"));
@@ -796,6 +804,18 @@ @@ -796,6 +805,18 @@
@Override @Override
public void b(int i) { public void b(int i) {

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/EntityItem.java --- a/net/minecraft/server/EntityItem.java
+++ b/net/minecraft/server/EntityItem.java +++ b/net/minecraft/server/EntityItem.java
@@ -5,6 +5,10 @@ @@ -6,6 +6,11 @@
import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.event.entity.EntityPickupItemEvent; +import org.bukkit.event.entity.EntityPickupItemEvent;
+import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.player.PlayerPickupItemEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityItem extends Entity { public class EntityItem extends Entity {
@@ -15,6 +19,7 @@ private static final DataWatcherObject<ItemStack> ITEM = DataWatcher.a(EntityItem.class, DataWatcherRegistry.g);
@@ -15,6 +20,7 @@
private UUID thrower; private UUID thrower;
private UUID owner; private UUID owner;
public final float b; public final float b;
@ -19,7 +20,7 @@
public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) { public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
@@ -50,9 +55,12 @@ @@ -50,9 +56,12 @@
this.die(); this.die();
} else { } else {
super.tick(); super.tick();
@ -35,7 +36,7 @@
this.lastX = this.locX(); this.lastX = this.locX();
this.lastY = this.locY(); this.lastY = this.locY();
@@ -108,9 +116,11 @@ @@ -108,9 +117,11 @@
} }
} }
@ -47,7 +48,7 @@
this.impulse |= this.aK(); this.impulse |= this.aK();
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@@ -122,6 +132,12 @@ @@ -122,6 +133,12 @@
} }
if (!this.world.isClientSide && this.age >= 6000) { if (!this.world.isClientSide && this.age >= 6000) {
@ -60,7 +61,7 @@
this.die(); this.die();
} }
@@ -197,10 +213,11 @@ @@ -197,10 +214,11 @@
private static void a(EntityItem entityitem, ItemStack itemstack, ItemStack itemstack1) { private static void a(EntityItem entityitem, ItemStack itemstack, ItemStack itemstack1) {
ItemStack itemstack2 = a(itemstack, itemstack1, 64); ItemStack itemstack2 = a(itemstack, itemstack1, 64);
@ -73,7 +74,7 @@
a(entityitem, itemstack, itemstack1); a(entityitem, itemstack, itemstack1);
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay); entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay);
entityitem.age = Math.min(entityitem.age, entityitem1.age); entityitem.age = Math.min(entityitem.age, entityitem1.age);
@@ -224,6 +241,11 @@ @@ -224,6 +242,11 @@
} else if (!this.getItemStack().getItem().a(damagesource)) { } else if (!this.getItemStack().getItem().a(damagesource)) {
return false; return false;
} else { } else {
@ -85,7 +86,7 @@
this.velocityChanged(); this.velocityChanged();
this.f = (int) ((float) this.f - f); this.f = (int) ((float) this.f - f);
if (this.f <= 0) { if (this.f <= 0) {
@@ -285,6 +307,46 @@ @@ -285,6 +308,46 @@
Item item = itemstack.getItem(); Item item = itemstack.getItem();
int i = itemstack.getCount(); int i = itemstack.getCount();
@ -132,7 +133,7 @@
if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) { if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) {
entityhuman.receive(this, i); entityhuman.receive(this, i);
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
@@ -328,7 +390,9 @@ @@ -328,7 +391,9 @@
} }
public void setItemStack(ItemStack itemstack) { public void setItemStack(ItemStack itemstack) {

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntityMinecartContainer.java --- a/net/minecraft/server/EntityMinecartContainer.java
+++ b/net/minecraft/server/EntityMinecartContainer.java +++ b/net/minecraft/server/EntityMinecartContainer.java
@@ -2,6 +2,13 @@ @@ -3,6 +3,14 @@
import java.util.Iterator; import java.util.Iterator;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import java.util.List; +import java.util.List;
+import org.bukkit.Location; +import org.bukkit.Location;
@ -11,10 +11,11 @@
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end +// CraftBukkit end
+
public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements IInventory, ITileInventory { public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements IInventory, ITileInventory {
@@ -11,15 +18,56 @@ private NonNullList<ItemStack> items;
@@ -11,15 +19,56 @@
public MinecraftKey lootTable; public MinecraftKey lootTable;
public long lootTableSeed; public long lootTableSeed;

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/EntityMushroomCow.java --- a/net/minecraft/server/EntityMushroomCow.java
+++ b/net/minecraft/server/EntityMushroomCow.java +++ b/net/minecraft/server/EntityMushroomCow.java
@@ -4,6 +4,10 @@ @@ -5,6 +5,11 @@
import java.util.Random;
import java.util.UUID; import java.util.UUID;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTransformEvent; +import org.bukkit.event.entity.EntityTransformEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityMushroomCow extends EntityCow implements IShearable { public class EntityMushroomCow extends EntityCow implements IShearable {
@@ -75,6 +79,11 @@ private static final DataWatcherObject<String> bo = DataWatcher.a(EntityMushroomCow.class, DataWatcherRegistry.d);
@@ -75,6 +80,11 @@
this.playSound(soundeffect, 1.0F, 1.0F); this.playSound(soundeffect, 1.0F, 1.0F);
return EnumInteractionResult.a(this.world.isClientSide); return EnumInteractionResult.a(this.world.isClientSide);
} else if (itemstack.getItem() == Items.SHEARS && this.canShear()) { } else if (itemstack.getItem() == Items.SHEARS && this.canShear()) {
@ -23,7 +24,7 @@
this.shear(SoundCategory.PLAYERS); this.shear(SoundCategory.PLAYERS);
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
itemstack.damage(1, entityhuman, (entityhuman1) -> { itemstack.damage(1, entityhuman, (entityhuman1) -> {
@@ -121,7 +130,7 @@ @@ -121,7 +131,7 @@
this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F); this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F);
if (!this.world.s_()) { if (!this.world.s_()) {
((WorldServer) this.world).a(Particles.EXPLOSION, this.locX(), this.e(0.5D), this.locZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D); ((WorldServer) this.world).a(Particles.EXPLOSION, this.locX(), this.e(0.5D), this.locZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D);
@ -32,7 +33,7 @@
EntityCow entitycow = (EntityCow) EntityTypes.COW.a(this.world); EntityCow entitycow = (EntityCow) EntityTypes.COW.a(this.world);
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch); entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
@@ -137,7 +146,14 @@ @@ -137,7 +147,14 @@
} }
entitycow.setInvulnerable(this.isInvulnerable()); entitycow.setInvulnerable(this.isInvulnerable());

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntityPotion.java --- a/net/minecraft/server/EntityPotion.java
+++ b/net/minecraft/server/EntityPotion.java +++ b/net/minecraft/server/EntityPotion.java
@@ -4,6 +4,13 @@ @@ -5,6 +5,14 @@
import java.util.List;
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import java.util.HashMap; +import java.util.HashMap;
+import java.util.Map; +import java.util.Map;
@ -11,10 +11,11 @@
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.LivingEntity;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityPotion extends EntityProjectileThrowable { public class EntityPotion extends EntityProjectileThrowable {
@@ -69,7 +76,7 @@ public static final Predicate<EntityLiving> b = EntityLiving::dO;
@@ -69,7 +77,7 @@
if (flag) { if (flag) {
this.splash(); this.splash();
@ -23,7 +24,7 @@
if (this.isLingering()) { if (this.isLingering()) {
this.a(itemstack, potionregistry); this.a(itemstack, potionregistry);
} else { } else {
@@ -106,6 +113,7 @@ @@ -106,6 +114,7 @@
private void a(List<MobEffect> list, @Nullable Entity entity) { private void a(List<MobEffect> list, @Nullable Entity entity) {
AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D); AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D);
List<EntityLiving> list1 = this.world.a(EntityLiving.class, axisalignedbb); List<EntityLiving> list1 = this.world.a(EntityLiving.class, axisalignedbb);
@ -31,7 +32,7 @@
if (!list1.isEmpty()) { if (!list1.isEmpty()) {
Iterator iterator = list1.iterator(); Iterator iterator = list1.iterator();
@@ -123,21 +131,46 @@ @@ -123,21 +132,46 @@
d1 = 1.0D; d1 = 1.0D;
} }
@ -42,20 +43,7 @@
+ } + }
+ } + }
+ } + }
+
- while (iterator1.hasNext()) {
- MobEffect mobeffect = (MobEffect) iterator1.next();
- MobEffectList mobeffectlist = mobeffect.getMobEffect();
-
- if (mobeffectlist.isInstant()) {
- mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect.getAmplifier(), d1);
- } else {
- int i = (int) (d1 * (double) mobeffect.getDuration() + 0.5D);
-
- if (i > 20) {
- entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isShowParticles()));
- }
- }
+ org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, affected); + org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, affected);
+ if (!event.isCancelled() && list != null && !list.isEmpty()) { // do not process effects if there are no effects to process + if (!event.isCancelled() && list != null && !list.isEmpty()) { // do not process effects if there are no effects to process
+ for (LivingEntity victim : event.getAffectedEntities()) { + for (LivingEntity victim : event.getAffectedEntities()) {
@ -86,13 +74,26 @@
+ mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect.getAmplifier(), d1); + mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect.getAmplifier(), d1);
+ } else { + } else {
+ int i = (int) (d1 * (double) mobeffect.getDuration() + 0.5D); + int i = (int) (d1 * (double) mobeffect.getDuration() + 0.5D);
+
- while (iterator1.hasNext()) {
- MobEffect mobeffect = (MobEffect) iterator1.next();
- MobEffectList mobeffectlist = mobeffect.getMobEffect();
-
- if (mobeffectlist.isInstant()) {
- mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect.getAmplifier(), d1);
- } else {
- int i = (int) (d1 * (double) mobeffect.getDuration() + 0.5D);
-
- if (i > 20) {
- entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isShowParticles()));
- }
- }
+ if (i > 20) { + if (i > 20) {
+ entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isShowParticles()), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_SPLASH); // CraftBukkit + entityliving.addEffect(new MobEffect(mobeffectlist, i, mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isShowParticles()), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_SPLASH); // CraftBukkit
} }
} }
} }
@@ -173,7 +206,14 @@ @@ -173,7 +207,14 @@
entityareaeffectcloud.setColor(nbttagcompound.getInt("CustomPotionColor")); entityareaeffectcloud.setColor(nbttagcompound.getInt("CustomPotionColor"));
} }
@ -108,7 +109,7 @@
} }
public boolean isLingering() { public boolean isLingering() {
@@ -184,11 +224,19 @@ @@ -184,11 +225,19 @@
IBlockData iblockdata = this.world.getType(blockposition); IBlockData iblockdata = this.world.getType(blockposition);
if (iblockdata.a((Tag) TagsBlock.FIRE)) { if (iblockdata.a((Tag) TagsBlock.FIRE)) {

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/EntityShulker.java --- a/net/minecraft/server/EntityShulker.java
+++ b/net/minecraft/server/EntityShulker.java +++ b/net/minecraft/server/EntityShulker.java
@@ -6,6 +6,10 @@ @@ -7,6 +7,11 @@
import java.util.Optional;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.event.entity.EntityTeleportEvent; +import org.bukkit.event.entity.EntityTeleportEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityShulker extends EntityGolem implements IMonster { public class EntityShulker extends EntityGolem implements IMonster {
@@ -31,7 +35,7 @@ private static final UUID bp = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F");
@@ -31,7 +36,7 @@
this.goalSelector.a(4, new EntityShulker.a()); this.goalSelector.a(4, new EntityShulker.a());
this.goalSelector.a(7, new EntityShulker.e()); this.goalSelector.a(7, new EntityShulker.e());
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
@ -20,7 +21,7 @@
this.targetSelector.a(2, new EntityShulker.d(this)); this.targetSelector.a(2, new EntityShulker.d(this));
this.targetSelector.a(3, new EntityShulker.c(this)); this.targetSelector.a(3, new EntityShulker.c(this));
} }
@@ -279,6 +283,16 @@ @@ -279,6 +284,16 @@
EnumDirection enumdirection = this.g(blockposition1); EnumDirection enumdirection = this.g(blockposition1);
if (enumdirection != null) { if (enumdirection != null) {
@ -37,7 +38,7 @@
this.datawatcher.set(EntityShulker.b, enumdirection); this.datawatcher.set(EntityShulker.b, enumdirection);
this.playSound(SoundEffects.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F); this.playSound(SoundEffects.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F);
this.datawatcher.set(EntityShulker.c, Optional.of(blockposition1)); this.datawatcher.set(EntityShulker.c, Optional.of(blockposition1));
@@ -319,6 +333,7 @@ @@ -319,6 +334,7 @@
} }
this.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D); this.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntitySlime.java --- a/net/minecraft/server/EntitySlime.java
+++ b/net/minecraft/server/EntitySlime.java +++ b/net/minecraft/server/EntitySlime.java
@@ -5,6 +5,13 @@ @@ -6,6 +6,14 @@
import java.util.Optional;
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import java.util.ArrayList; +import java.util.ArrayList;
+import java.util.List; +import java.util.List;
@ -11,10 +11,11 @@
+import org.bukkit.event.entity.EntityTransformEvent; +import org.bukkit.event.entity.EntityTransformEvent;
+import org.bukkit.event.entity.SlimeSplitEvent; +import org.bukkit.event.entity.SlimeSplitEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntitySlime extends EntityInsentient implements IMonster { public class EntitySlime extends EntityInsentient implements IMonster {
@@ -149,7 +156,7 @@ private static final DataWatcherObject<Integer> bo = DataWatcher.a(EntitySlime.class, DataWatcherRegistry.b);
@@ -149,7 +157,7 @@
@Override @Override
public EntityTypes<? extends EntitySlime> getEntityType() { public EntityTypes<? extends EntitySlime> getEntityType() {
@ -23,7 +24,7 @@
} }
@Override @Override
@@ -163,6 +170,19 @@ @@ -163,6 +171,19 @@
int j = i / 2; int j = i / 2;
int k = 2 + this.random.nextInt(3); int k = 2 + this.random.nextInt(3);
@ -43,7 +44,7 @@
for (int l = 0; l < k; ++l) { for (int l = 0; l < k; ++l) {
float f1 = ((float) (l % 2) - 0.5F) * f; float f1 = ((float) (l % 2) - 0.5F) * f;
float f2 = ((float) (l / 2) - 0.5F) * f; float f2 = ((float) (l / 2) - 0.5F) * f;
@@ -177,8 +197,17 @@ @@ -177,8 +198,17 @@
entityslime.setInvulnerable(this.isInvulnerable()); entityslime.setInvulnerable(this.isInvulnerable());
entityslime.setSize(j, true); entityslime.setSize(j, true);
entityslime.setPositionRotation(this.locX() + (double) f1, this.locY() + 0.5D, this.locZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F); entityslime.setPositionRotation(this.locX() + (double) f1, this.locY() + 0.5D, this.locZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);

View File

@ -1,16 +1,17 @@
--- a/net/minecraft/server/EntitySnowman.java --- a/net/minecraft/server/EntitySnowman.java
+++ b/net/minecraft/server/EntitySnowman.java +++ b/net/minecraft/server/EntitySnowman.java
@@ -1,6 +1,9 @@ @@ -2,6 +2,10 @@
package net.minecraft.server;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end +// CraftBukkit end
+
public class EntitySnowman extends EntityGolem implements IShearable, IRangedEntity { public class EntitySnowman extends EntityGolem implements IShearable, IRangedEntity {
@@ -60,7 +63,7 @@ private static final DataWatcherObject<Byte> b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a);
@@ -60,7 +64,7 @@
int k = MathHelper.floor(this.locZ()); int k = MathHelper.floor(this.locZ());
if (this.world.getBiome(new BlockPosition(i, 0, k)).getAdjustedTemperature(new BlockPosition(i, j, k)) > 1.0F) { if (this.world.getBiome(new BlockPosition(i, 0, k)).getAdjustedTemperature(new BlockPosition(i, j, k)) > 1.0F) {
@ -19,7 +20,7 @@
} }
if (!this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { if (!this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
@@ -76,7 +79,7 @@ @@ -76,7 +80,7 @@
BlockPosition blockposition = new BlockPosition(i, j, k); BlockPosition blockposition = new BlockPosition(i, j, k);
if (this.world.getType(blockposition).isAir() && this.world.getBiome(blockposition).getAdjustedTemperature(blockposition) < 0.8F && iblockdata.canPlace(this.world, blockposition)) { if (this.world.getType(blockposition).isAir() && this.world.getBiome(blockposition).getAdjustedTemperature(blockposition) < 0.8F && iblockdata.canPlace(this.world, blockposition)) {
@ -28,7 +29,7 @@
} }
} }
} }
@@ -107,6 +110,11 @@ @@ -107,6 +111,11 @@
ItemStack itemstack = entityhuman.b(enumhand); ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.getItem() == Items.SHEARS && this.canShear()) { if (itemstack.getItem() == Items.SHEARS && this.canShear()) {

View File

@ -1,14 +1,14 @@
--- a/net/minecraft/server/EntityTNTPrimed.java --- a/net/minecraft/server/EntityTNTPrimed.java
+++ b/net/minecraft/server/EntityTNTPrimed.java +++ b/net/minecraft/server/EntityTNTPrimed.java
@@ -1,6 +1,7 @@ @@ -2,12 +2,16 @@
package net.minecraft.server;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+
public class EntityTNTPrimed extends Entity { public class EntityTNTPrimed extends Entity {
@@ -8,6 +9,8 @@ private static final DataWatcherObject<Integer> FUSE_TICKS = DataWatcher.a(EntityTNTPrimed.class, DataWatcherRegistry.b);
@Nullable @Nullable
public EntityLiving source; public EntityLiving source;
private int fuseTicks; private int fuseTicks;
@ -17,7 +17,7 @@
public EntityTNTPrimed(EntityTypes<? extends EntityTNTPrimed> entitytypes, World world) { public EntityTNTPrimed(EntityTypes<? extends EntityTNTPrimed> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
@@ -57,10 +60,13 @@ @@ -57,10 +61,13 @@
--this.fuseTicks; --this.fuseTicks;
if (this.fuseTicks <= 0) { if (this.fuseTicks <= 0) {
@ -32,7 +32,7 @@
} else { } else {
this.aK(); this.aK();
if (this.world.isClientSide) { if (this.world.isClientSide) {
@@ -71,9 +77,16 @@ @@ -71,9 +78,16 @@
} }
private void explode() { private void explode() {

View File

@ -1,14 +1,6 @@
--- a/net/minecraft/server/EntityVex.java --- a/net/minecraft/server/EntityVex.java
+++ b/net/minecraft/server/EntityVex.java +++ b/net/minecraft/server/EntityVex.java
@@ -2,6 +2,7 @@ @@ -45,7 +45,7 @@
import java.util.EnumSet;
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityTargetEvent;
public class EntityVex extends EntityMonster {
@@ -45,7 +46,7 @@
this.goalSelector.a(8, new EntityVex.d()); this.goalSelector.a(8, new EntityVex.d());
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
@ -17,12 +9,12 @@
this.targetSelector.a(2, new EntityVex.b(this)); this.targetSelector.a(2, new EntityVex.b(this));
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
} }
@@ -186,7 +187,7 @@ @@ -186,7 +186,7 @@
@Override @Override
public void c() { public void c() {
- EntityVex.this.setGoalTarget(EntityVex.this.c.getGoalTarget()); - EntityVex.this.setGoalTarget(EntityVex.this.c.getGoalTarget());
+ EntityVex.this.setGoalTarget(EntityVex.this.c.getGoalTarget(), EntityTargetEvent.TargetReason.OWNER_ATTACKED_TARGET, true); // CraftBukkit + EntityVex.this.setGoalTarget(EntityVex.this.c.getGoalTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.OWNER_ATTACKED_TARGET, true); // CraftBukkit
super.c(); super.c();
} }
} }

View File

@ -1,23 +1,21 @@
--- a/net/minecraft/server/EntityVillager.java --- a/net/minecraft/server/EntityVillager.java
+++ b/net/minecraft/server/EntityVillager.java +++ b/net/minecraft/server/EntityVillager.java
@@ -18,6 +18,16 @@ @@ -19,6 +19,14 @@
import java.util.stream.Collectors;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.entity.CraftVillager;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe;
+import org.bukkit.entity.Villager; +import org.bukkit.entity.Villager;
+import org.bukkit.event.entity.EntityTransformEvent; +import org.bukkit.event.entity.EntityTransformEvent;
+import org.bukkit.event.entity.VillagerAcquireTradeEvent;
+import org.bukkit.event.entity.VillagerReplenishTradeEvent; +import org.bukkit.event.entity.VillagerReplenishTradeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder { public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder {
@@ -64,7 +74,7 @@ private static final DataWatcherObject<VillagerData> br = DataWatcher.a(EntityVillager.class, DataWatcherRegistry.q);
@@ -64,7 +72,7 @@
@Override @Override
public BehaviorController<EntityVillager> getBehaviorController() { public BehaviorController<EntityVillager> getBehaviorController() {
@ -26,7 +24,7 @@
} }
@Override @Override
@@ -83,7 +93,7 @@ @@ -83,7 +91,7 @@
public void c(WorldServer worldserver) { public void c(WorldServer worldserver) {
BehaviorController<EntityVillager> behaviorcontroller = this.getBehaviorController(); BehaviorController<EntityVillager> behaviorcontroller = this.getBehaviorController();
@ -35,7 +33,7 @@
this.bg = behaviorcontroller.h(); this.bg = behaviorcontroller.h();
this.a(this.getBehaviorController()); this.a(this.getBehaviorController());
} }
@@ -133,7 +143,7 @@ @@ -133,7 +141,7 @@
@Override @Override
protected void mobTick() { protected void mobTick() {
this.world.getMethodProfiler().enter("villagerBrain"); this.world.getMethodProfiler().enter("villagerBrain");
@ -44,7 +42,7 @@
this.world.getMethodProfiler().exit(); this.world.getMethodProfiler().exit();
if (this.bF) { if (this.bF) {
this.bF = false; this.bF = false;
@@ -147,7 +157,7 @@ @@ -147,7 +155,7 @@
this.bu = false; this.bu = false;
} }
@ -53,7 +51,7 @@
} }
} }
@@ -358,7 +368,14 @@ @@ -358,7 +366,14 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next(); MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
@ -69,7 +67,7 @@
} }
} }
@@ -387,7 +404,7 @@ @@ -387,7 +402,7 @@
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
super.saveData(nbttagcompound); super.saveData(nbttagcompound);
@ -78,7 +76,7 @@
Logger logger = EntityVillager.LOGGER; Logger logger = EntityVillager.LOGGER;
logger.getClass(); logger.getClass();
@@ -700,7 +717,12 @@ @@ -700,7 +715,12 @@
} }
entitywitch.setPersistent(); entitywitch.setPersistent();
@ -92,7 +90,7 @@
this.fq(); this.fq();
this.die(); this.die();
} else { } else {
@@ -833,7 +855,7 @@ @@ -833,7 +853,7 @@
if (entityirongolem != null) { if (entityirongolem != null) {
if (entityirongolem.a((GeneratorAccess) worldserver, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) worldserver)) { if (entityirongolem.a((GeneratorAccess) worldserver, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) worldserver)) {
@ -101,7 +99,7 @@
return entityirongolem; return entityirongolem;
} }
@@ -911,7 +933,7 @@ @@ -911,7 +931,7 @@
@Override @Override
public void entitySleep(BlockPosition blockposition) { public void entitySleep(BlockPosition blockposition) {
super.entitySleep(blockposition); super.entitySleep(blockposition);
@ -110,7 +108,7 @@
this.bg.removeMemory(MemoryModuleType.WALK_TARGET); this.bg.removeMemory(MemoryModuleType.WALK_TARGET);
this.bg.removeMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE); this.bg.removeMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
} }
@@ -919,7 +941,7 @@ @@ -919,7 +939,7 @@
@Override @Override
public void entityWakeup() { public void entityWakeup() {
super.entityWakeup(); super.entityWakeup();

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntityVillagerAbstract.java --- a/net/minecraft/server/EntityVillagerAbstract.java
+++ b/net/minecraft/server/EntityVillagerAbstract.java +++ b/net/minecraft/server/EntityVillagerAbstract.java
@@ -4,15 +4,30 @@ @@ -5,14 +5,30 @@
import java.util.Iterator;
import java.util.Set; import java.util.Set;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.inventory.CraftMerchant; +import org.bukkit.craftbukkit.inventory.CraftMerchant;
@ -11,7 +11,7 @@
+import org.bukkit.entity.AbstractVillager; +import org.bukkit.entity.AbstractVillager;
+import org.bukkit.event.entity.VillagerAcquireTradeEvent; +import org.bukkit.event.entity.VillagerAcquireTradeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public abstract class EntityVillagerAbstract extends EntityAgeable implements NPC, IMerchant { public abstract class EntityVillagerAbstract extends EntityAgeable implements NPC, IMerchant {
+ // CraftBukkit start + // CraftBukkit start
@ -32,7 +32,7 @@
public EntityVillagerAbstract(EntityTypes<? extends EntityVillagerAbstract> entitytypes, World world) { public EntityVillagerAbstract(EntityTypes<? extends EntityVillagerAbstract> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
@@ -213,7 +228,16 @@ @@ -213,7 +229,16 @@
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random); MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random);
if (merchantrecipe != null) { if (merchantrecipe != null) {

View File

@ -1,19 +1,20 @@
--- a/net/minecraft/server/EntityVillagerTrader.java --- a/net/minecraft/server/EntityVillagerTrader.java
+++ b/net/minecraft/server/EntityVillagerTrader.java +++ b/net/minecraft/server/EntityVillagerTrader.java
@@ -2,6 +2,12 @@ @@ -3,6 +3,13 @@
import java.util.EnumSet; import java.util.EnumSet;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; +import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe;
+import org.bukkit.entity.AbstractVillager; +import org.bukkit.entity.AbstractVillager;
+import org.bukkit.event.entity.VillagerAcquireTradeEvent; +import org.bukkit.event.entity.VillagerAcquireTradeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityVillagerTrader extends EntityVillagerAbstract { public class EntityVillagerTrader extends EntityVillagerAbstract {
@@ -12,6 +18,7 @@ @Nullable
@@ -12,6 +19,7 @@
public EntityVillagerTrader(EntityTypes<? extends EntityVillagerTrader> entitytypes, World world) { public EntityVillagerTrader(EntityTypes<? extends EntityVillagerTrader> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
this.attachedToPlayer = true; this.attachedToPlayer = true;
@ -21,7 +22,7 @@
} }
@Override @Override
@@ -89,7 +96,16 @@ @@ -89,7 +97,16 @@
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random); MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random);
if (merchantrecipe != null) { if (merchantrecipe != null) {

View File

@ -1,11 +1,10 @@
--- a/net/minecraft/server/EntityZombie.java --- a/net/minecraft/server/EntityZombie.java
+++ b/net/minecraft/server/EntityZombie.java +++ b/net/minecraft/server/EntityZombie.java
@@ -9,6 +9,15 @@ @@ -9,6 +9,14 @@
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.entity.Zombie; +import org.bukkit.entity.Zombie;
+import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.EntityCombustByEntityEvent; +import org.bukkit.event.entity.EntityCombustByEntityEvent;
@ -16,7 +15,7 @@
public class EntityZombie extends EntityMonster { public class EntityZombie extends EntityMonster {
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
@@ -23,6 +32,7 @@ @@ -23,6 +31,7 @@
private boolean bs; private boolean bs;
private int bt; private int bt;
public int drownedConversionTime; public int drownedConversionTime;
@ -24,7 +23,7 @@
public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) { public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
@@ -139,7 +149,10 @@ @@ -139,7 +148,10 @@
public void tick() { public void tick() {
if (!this.world.isClientSide && this.isAlive() && !this.isNoAI()) { if (!this.world.isClientSide && this.isAlive() && !this.isNoAI()) {
if (this.isDrownConverting()) { if (this.isDrownConverting()) {
@ -36,7 +35,7 @@
if (this.drownedConversionTime < 0) { if (this.drownedConversionTime < 0) {
this.eP(); this.eP();
} }
@@ -156,6 +169,7 @@ @@ -156,6 +168,7 @@
} }
super.tick(); super.tick();
@ -44,7 +43,7 @@
} }
@Override @Override
@@ -188,6 +202,7 @@ @@ -188,6 +201,7 @@
} }
public void startDrownedConversion(int i) { public void startDrownedConversion(int i) {
@ -52,7 +51,7 @@
this.drownedConversionTime = i; this.drownedConversionTime = i;
this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true); this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true);
} }
@@ -201,11 +216,15 @@ @@ -201,11 +215,15 @@
} }
protected void b(EntityTypes<? extends EntityZombie> entitytypes) { protected void b(EntityTypes<? extends EntityZombie> entitytypes) {
@ -69,7 +68,7 @@
} }
} }
@@ -245,9 +264,9 @@ @@ -245,9 +263,9 @@
if (SpawnerCreature.a(entitypositiontypes_surface, (IWorldReader) this.world, blockposition, entitytypes) && EntityPositionTypes.a(entitytypes, worldserver, EnumMobSpawn.REINFORCEMENT, blockposition, this.world.random)) { if (SpawnerCreature.a(entitypositiontypes_surface, (IWorldReader) this.world, blockposition, entitytypes) && EntityPositionTypes.a(entitytypes, worldserver, EnumMobSpawn.REINFORCEMENT, blockposition, this.world.random)) {
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.j((Entity) entityzombie) && this.world.getCubes(entityzombie) && !this.world.containsLiquid(entityzombie.getBoundingBox())) { if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.j((Entity) entityzombie) && this.world.getCubes(entityzombie) && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
@ -81,7 +80,7 @@
this.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).addModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION)); this.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).addModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION));
entityzombie.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).addModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION)); entityzombie.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).addModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION));
break; break;
@@ -268,7 +287,14 @@ @@ -268,7 +286,14 @@
float f = this.world.getDamageScaler(this.getChunkCoordinates()).b(); float f = this.world.getDamageScaler(this.getChunkCoordinates()).b();
if (this.getItemInMainHand().isEmpty() && this.isBurning() && this.random.nextFloat() < f * 0.3F) { if (this.getItemInMainHand().isEmpty() && this.isBurning() && this.random.nextFloat() < f * 0.3F) {
@ -97,7 +96,7 @@
} }
} }
@@ -349,7 +375,12 @@ @@ -349,7 +374,12 @@
} }
EntityVillager entityvillager = (EntityVillager) entityliving; EntityVillager entityvillager = (EntityVillager) entityliving;
@ -111,7 +110,7 @@
entityzombievillager.prepare(worldserver, worldserver.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), (NBTTagCompound) null); entityzombievillager.prepare(worldserver, worldserver.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), (NBTTagCompound) null);
entityzombievillager.setVillagerData(entityvillager.getVillagerData()); entityzombievillager.setVillagerData(entityvillager.getVillagerData());
@@ -406,7 +437,7 @@ @@ -406,7 +436,7 @@
entitychicken1.prepare(worldaccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null); entitychicken1.prepare(worldaccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null);
entitychicken1.setChickenJockey(true); entitychicken1.setChickenJockey(true);
this.startRiding(entitychicken1); this.startRiding(entitychicken1);

View File

@ -1,18 +1,18 @@
--- a/net/minecraft/server/EntityZombieVillager.java --- a/net/minecraft/server/EntityZombieVillager.java
+++ b/net/minecraft/server/EntityZombieVillager.java +++ b/net/minecraft/server/EntityZombieVillager.java
@@ -5,6 +5,12 @@ @@ -6,6 +6,12 @@
import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.entity.ZombieVillager; +import org.bukkit.entity.ZombieVillager;
+import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.EntityTransformEvent; +import org.bukkit.event.entity.EntityTransformEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder { public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder {
public static final DataWatcherObject<Boolean> CONVERTING = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.i);
@@ -15,6 +21,7 @@ @@ -15,6 +21,7 @@
private NBTBase bp; private NBTBase bp;
private NBTTagCompound bq; private NBTTagCompound bq;

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/FluidTypeFlowing.java --- a/net/minecraft/server/FluidTypeFlowing.java
+++ b/net/minecraft/server/FluidTypeFlowing.java +++ b/net/minecraft/server/FluidTypeFlowing.java
@@ -10,6 +10,14 @@ @@ -11,6 +11,15 @@
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.block.BlockFace; +import org.bukkit.block.BlockFace;
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
@ -12,10 +12,11 @@
+import org.bukkit.event.block.BlockFromToEvent; +import org.bukkit.event.block.BlockFromToEvent;
+import org.bukkit.event.block.FluidLevelChangeEvent; +import org.bukkit.event.block.FluidLevelChangeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public abstract class FluidTypeFlowing extends FluidType { public abstract class FluidTypeFlowing extends FluidType {
@@ -110,6 +118,15 @@ public static final BlockStateBoolean FALLING = BlockProperties.i;
@@ -110,6 +119,15 @@
Fluid fluid1 = this.a((IWorldReader) generatoraccess, blockposition1, iblockdata1); Fluid fluid1 = this.a((IWorldReader) generatoraccess, blockposition1, iblockdata1);
if (this.a(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.getType())) { if (this.a(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.getType())) {
@ -31,7 +32,7 @@
this.a(generatoraccess, blockposition1, iblockdata1, EnumDirection.DOWN, fluid1); this.a(generatoraccess, blockposition1, iblockdata1, EnumDirection.DOWN, fluid1);
if (this.a((IWorldReader) generatoraccess, blockposition) >= 3) { if (this.a((IWorldReader) generatoraccess, blockposition) >= 3) {
this.a(generatoraccess, blockposition, fluid, iblockdata); this.a(generatoraccess, blockposition, fluid, iblockdata);
@@ -140,6 +157,15 @@ @@ -140,6 +158,15 @@
IBlockData iblockdata1 = generatoraccess.getType(blockposition1); IBlockData iblockdata1 = generatoraccess.getType(blockposition1);
if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.getType())) { if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.getType())) {
@ -47,7 +48,7 @@
this.a(generatoraccess, blockposition1, iblockdata1, enumdirection, fluid1); this.a(generatoraccess, blockposition1, iblockdata1, enumdirection, fluid1);
} }
} }
@@ -418,12 +444,23 @@ @@ -418,12 +445,23 @@
if (fluid1.isEmpty()) { if (fluid1.isEmpty()) {
fluid = fluid1; fluid = fluid1;

View File

@ -1,15 +1,12 @@
--- a/net/minecraft/server/FurnaceRecipe.java --- a/net/minecraft/server/FurnaceRecipe.java
+++ b/net/minecraft/server/FurnaceRecipe.java +++ b/net/minecraft/server/FurnaceRecipe.java
@@ -1,5 +1,16 @@ @@ -1,5 +1,13 @@
package net.minecraft.server; package net.minecraft.server;
+// CraftBukkit start +// CraftBukkit start
+import java.util.ArrayList;
+import java.util.List;
+import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe; +import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe; +import org.bukkit.craftbukkit.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey; +import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.inventory.Recipe; +import org.bukkit.inventory.Recipe;
+// CraftBukkit end +// CraftBukkit end
@ -17,7 +14,7 @@
public class FurnaceRecipe extends RecipeCooking { public class FurnaceRecipe extends RecipeCooking {
public FurnaceRecipe(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) { public FurnaceRecipe(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
@@ -10,4 +21,14 @@ @@ -10,4 +18,14 @@
public RecipeSerializer<?> getRecipeSerializer() { public RecipeSerializer<?> getRecipeSerializer() {
return RecipeSerializer.p; return RecipeSerializer.p;
} }

View File

@ -1,16 +1,18 @@
--- a/net/minecraft/server/IChatBaseComponent.java --- a/net/minecraft/server/IChatBaseComponent.java
+++ b/net/minecraft/server/IChatBaseComponent.java +++ b/net/minecraft/server/IChatBaseComponent.java
@@ -22,8 +22,21 @@ @@ -23,7 +23,23 @@
import java.util.Map.Entry;
import java.util.Optional; import java.util.Optional;
import javax.annotation.Nullable; import javax.annotation.Nullable;
-public interface IChatBaseComponent extends Message, IChatFormatted {
+// CraftBukkit start +// CraftBukkit start
+import com.google.common.collect.Streams; +import com.google.common.collect.Streams;
+import java.util.stream.Stream; +import java.util.stream.Stream;
+// CraftBukkit end
-public interface IChatBaseComponent extends Message, IChatFormatted {
+public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IChatBaseComponent> {
+ +
+public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IChatBaseComponent> { // CraftBukkit
+
+ // CraftBukkit start
+ default Stream<IChatBaseComponent> stream() { + default Stream<IChatBaseComponent> stream() {
+ return Streams.concat(new Stream[]{Stream.of(this), this.getSiblings().stream().flatMap(IChatBaseComponent::stream)}); + return Streams.concat(new Stream[]{Stream.of(this), this.getSiblings().stream().flatMap(IChatBaseComponent::stream)});
+ } + }

View File

@ -1,21 +1,21 @@
--- a/net/minecraft/server/IDispenseBehavior.java --- a/net/minecraft/server/IDispenseBehavior.java
+++ b/net/minecraft/server/IDispenseBehavior.java +++ b/net/minecraft/server/IDispenseBehavior.java
@@ -3,6 +3,15 @@ @@ -4,6 +4,15 @@
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.TreeType; +import org.bukkit.TreeType;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.util.DummyGeneratorAccess; +import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
+import org.bukkit.event.block.BlockDispenseEvent; +import org.bukkit.event.block.BlockDispenseEvent;
+import org.bukkit.event.world.StructureGrowEvent; +import org.bukkit.event.world.StructureGrowEvent;
+// CraftBukkit end +// CraftBukkit end
+
public interface IDispenseBehavior { public interface IDispenseBehavior {
IDispenseBehavior NONE = (isourceblock, itemstack) -> {
@@ -44,7 +53,7 @@ @@ -44,7 +53,7 @@
BlockDispenser.a((IMaterial) Items.EGG, (IDispenseBehavior) (new DispenseBehaviorProjectile() { BlockDispenser.a((IMaterial) Items.EGG, (IDispenseBehavior) (new DispenseBehaviorProjectile() {
@Override @Override

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/IInventory.java --- a/net/minecraft/server/IInventory.java
+++ b/net/minecraft/server/IInventory.java +++ b/net/minecraft/server/IInventory.java
@@ -1,6 +1,7 @@ @@ -2,6 +2,8 @@
package net.minecraft.server;
import java.util.Set; import java.util.Set;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; // CraftBukkit
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; // CraftBukkit
+
public interface IInventory extends Clearable { public interface IInventory extends Clearable {
@@ -16,9 +17,7 @@ int getSize();
@@ -16,9 +18,7 @@
void setItem(int i, ItemStack itemstack); void setItem(int i, ItemStack itemstack);
@ -19,7 +20,7 @@
void update(); void update();
@@ -57,4 +56,29 @@ @@ -57,4 +57,29 @@
return false; return false;
} }

View File

@ -1,18 +1,18 @@
--- a/net/minecraft/server/InventoryCraftResult.java --- a/net/minecraft/server/InventoryCraftResult.java
+++ b/net/minecraft/server/InventoryCraftResult.java +++ b/net/minecraft/server/InventoryCraftResult.java
@@ -2,6 +2,11 @@ @@ -3,12 +3,51 @@
import java.util.Iterator; import java.util.Iterator;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+// CraftBukkit end +// CraftBukkit end
+
public class InventoryCraftResult implements IInventory, RecipeHolder { public class InventoryCraftResult implements IInventory, RecipeHolder {
@@ -9,6 +14,39 @@ private final NonNullList<ItemStack> items;
@Nullable @Nullable
private IRecipe<?> b; private IRecipe<?> b;

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/InventoryCrafting.java --- a/net/minecraft/server/InventoryCrafting.java
+++ b/net/minecraft/server/InventoryCrafting.java +++ b/net/minecraft/server/InventoryCrafting.java
@@ -1,6 +1,14 @@ @@ -2,6 +2,15 @@
package net.minecraft.server;
import java.util.Iterator; import java.util.Iterator;
+// CraftBukkit start +// CraftBukkit start
+import java.util.List; +import java.util.List;
+import org.bukkit.Location; +import org.bukkit.Location;
@ -12,10 +12,11 @@
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+import org.bukkit.event.inventory.InventoryType; +import org.bukkit.event.inventory.InventoryType;
+// CraftBukkit end +// CraftBukkit end
+
public class InventoryCrafting implements IInventory, AutoRecipeOutput { public class InventoryCrafting implements IInventory, AutoRecipeOutput {
@@ -9,6 +17,68 @@ private final NonNullList<ItemStack> items;
@@ -9,6 +18,68 @@
private final int c; private final int c;
public final Container container; public final Container container;

View File

@ -1,10 +1,12 @@
--- a/net/minecraft/server/InventoryEnderChest.java --- a/net/minecraft/server/InventoryEnderChest.java
+++ b/net/minecraft/server/InventoryEnderChest.java +++ b/net/minecraft/server/InventoryEnderChest.java
@@ -1,11 +1,27 @@ @@ -1,11 +1,29 @@
package net.minecraft.server; package net.minecraft.server;
+// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end
+ +
public class InventoryEnderChest extends InventorySubcontainer { public class InventoryEnderChest extends InventorySubcontainer {

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/InventoryMerchant.java --- a/net/minecraft/server/InventoryMerchant.java
+++ b/net/minecraft/server/InventoryMerchant.java +++ b/net/minecraft/server/InventoryMerchant.java
@@ -2,6 +2,13 @@ @@ -3,6 +3,14 @@
import java.util.Iterator; import java.util.Iterator;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import java.util.List; +import java.util.List;
+import org.bukkit.Location; +import org.bukkit.Location;
@ -11,10 +11,11 @@
+import org.bukkit.craftbukkit.entity.CraftAbstractVillager; +import org.bukkit.craftbukkit.entity.CraftAbstractVillager;
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+// CraftBukkit end +// CraftBukkit end
+
public class InventoryMerchant implements IInventory { public class InventoryMerchant implements IInventory {
@@ -12,6 +19,46 @@ private final IMerchant merchant;
@@ -12,6 +20,46 @@
public int selectedIndex; public int selectedIndex;
private int e; private int e;

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/ItemBlock.java --- a/net/minecraft/server/ItemBlock.java
+++ b/net/minecraft/server/ItemBlock.java +++ b/net/minecraft/server/ItemBlock.java
@@ -3,6 +3,11 @@ @@ -4,6 +4,12 @@
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.craftbukkit.block.data.CraftBlockData;
+import org.bukkit.event.block.BlockCanBuildEvent; +import org.bukkit.event.block.BlockCanBuildEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class ItemBlock extends Item { public class ItemBlock extends Item {
@@ -31,6 +36,12 @@ @Deprecated
@@ -31,6 +37,12 @@
return EnumInteractionResult.FAIL; return EnumInteractionResult.FAIL;
} else { } else {
IBlockData iblockdata = this.c(blockactioncontext1); IBlockData iblockdata = this.c(blockactioncontext1);
@ -25,7 +26,7 @@
if (iblockdata == null) { if (iblockdata == null) {
return EnumInteractionResult.FAIL; return EnumInteractionResult.FAIL;
@@ -48,6 +59,15 @@ @@ -48,6 +60,15 @@
iblockdata1 = this.a(blockposition, world, itemstack, iblockdata1); iblockdata1 = this.a(blockposition, world, itemstack, iblockdata1);
this.a(blockposition, world, entityhuman, itemstack, iblockdata1); this.a(blockposition, world, entityhuman, itemstack, iblockdata1);
block.postPlace(world, blockposition, iblockdata1, entityhuman, itemstack); block.postPlace(world, blockposition, iblockdata1, entityhuman, itemstack);
@ -41,7 +42,7 @@
if (entityhuman instanceof EntityPlayer) { if (entityhuman instanceof EntityPlayer) {
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition, itemstack); CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition, itemstack);
} }
@@ -55,8 +75,8 @@ @@ -55,8 +76,8 @@
SoundEffectType soundeffecttype = iblockdata1.getStepSound(); SoundEffectType soundeffecttype = iblockdata1.getStepSound();
@ -52,7 +53,7 @@
itemstack.subtract(1); itemstack.subtract(1);
} }
@@ -92,6 +112,21 @@ @@ -92,6 +113,21 @@
if (nbttagcompound != null) { if (nbttagcompound != null) {
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("BlockStateTag"); NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("BlockStateTag");
@ -74,7 +75,7 @@
BlockStateList<Block, IBlockData> blockstatelist = iblockdata.getBlock().getStates(); BlockStateList<Block, IBlockData> blockstatelist = iblockdata.getBlock().getStates();
Iterator iterator = nbttagcompound1.getKeys().iterator(); Iterator iterator = nbttagcompound1.getKeys().iterator();
@@ -106,11 +141,6 @@ @@ -106,11 +142,6 @@
} }
} }
} }
@ -86,7 +87,7 @@
return iblockdata1; return iblockdata1;
} }
@@ -123,8 +153,15 @@ @@ -123,8 +154,15 @@
protected boolean b(BlockActionContext blockactioncontext, IBlockData iblockdata) { protected boolean b(BlockActionContext blockactioncontext, IBlockData iblockdata) {
EntityHuman entityhuman = blockactioncontext.getEntity(); EntityHuman entityhuman = blockactioncontext.getEntity();
VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a((Entity) entityhuman); VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a((Entity) entityhuman);

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/ItemBucket.java --- a/net/minecraft/server/ItemBucket.java
+++ b/net/minecraft/server/ItemBucket.java +++ b/net/minecraft/server/ItemBucket.java
@@ -1,6 +1,13 @@ @@ -2,6 +2,14 @@
package net.minecraft.server;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
@ -11,10 +11,11 @@
+import org.bukkit.event.player.PlayerBucketEmptyEvent; +import org.bukkit.event.player.PlayerBucketEmptyEvent;
+import org.bukkit.event.player.PlayerBucketFillEvent; +import org.bukkit.event.player.PlayerBucketFillEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class ItemBucket extends Item { public class ItemBucket extends Item {
@@ -32,12 +39,22 @@ public final FluidType fluidType;
@@ -32,12 +40,22 @@
if (this.fluidType == FluidTypes.EMPTY) { if (this.fluidType == FluidTypes.EMPTY) {
iblockdata = world.getType(blockposition); iblockdata = world.getType(blockposition);
if (iblockdata.getBlock() instanceof IFluidSource) { if (iblockdata.getBlock() instanceof IFluidSource) {
@ -38,7 +39,7 @@
if (!world.isClientSide) { if (!world.isClientSide) {
CriterionTriggers.j.a((EntityPlayer) entityhuman, new ItemStack(fluidtype.a())); CriterionTriggers.j.a((EntityPlayer) entityhuman, new ItemStack(fluidtype.a()));
@@ -52,7 +69,7 @@ @@ -52,7 +70,7 @@
iblockdata = world.getType(blockposition); iblockdata = world.getType(blockposition);
BlockPosition blockposition2 = iblockdata.getBlock() instanceof IFluidContainer && this.fluidType == FluidTypes.WATER ? blockposition : blockposition1; BlockPosition blockposition2 = iblockdata.getBlock() instanceof IFluidContainer && this.fluidType == FluidTypes.WATER ? blockposition : blockposition1;
@ -47,7 +48,7 @@
this.a(world, itemstack, blockposition2); this.a(world, itemstack, blockposition2);
if (entityhuman instanceof EntityPlayer) { if (entityhuman instanceof EntityPlayer) {
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition2, itemstack); CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition2, itemstack);
@@ -77,6 +94,11 @@ @@ -77,6 +95,11 @@
public void a(World world, ItemStack itemstack, BlockPosition blockposition) {} public void a(World world, ItemStack itemstack, BlockPosition blockposition) {}
public boolean a(@Nullable EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPositionBlock movingobjectpositionblock) { public boolean a(@Nullable EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPositionBlock movingobjectpositionblock) {
@ -59,7 +60,7 @@
if (!(this.fluidType instanceof FluidTypeFlowing)) { if (!(this.fluidType instanceof FluidTypeFlowing)) {
return false; return false;
} else { } else {
@@ -86,8 +108,18 @@ @@ -86,8 +109,18 @@
boolean flag = iblockdata.a(this.fluidType); boolean flag = iblockdata.a(this.fluidType);
boolean flag1 = iblockdata.isAir() || flag || block instanceof IFluidContainer && ((IFluidContainer) block).canPlace(world, blockposition, iblockdata, this.fluidType); boolean flag1 = iblockdata.isAir() || flag || block instanceof IFluidContainer && ((IFluidContainer) block).canPlace(world, blockposition, iblockdata, this.fluidType);

View File

@ -1,19 +1,20 @@
--- a/net/minecraft/server/LootTable.java --- a/net/minecraft/server/LootTable.java
+++ b/net/minecraft/server/LootTable.java +++ b/net/minecraft/server/LootTable.java
@@ -18,6 +18,12 @@ @@ -19,6 +19,13 @@
import org.apache.commons.lang3.ArrayUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import java.util.stream.Collectors; +import java.util.stream.Collectors;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.world.LootGenerateEvent; +import org.bukkit.event.world.LootGenerateEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class LootTable { public class LootTable {
@@ -103,8 +109,21 @@ private static final Logger LOGGER = LogManager.getLogger();
@@ -103,8 +110,21 @@
} }
public void fillInventory(IInventory iinventory, LootTableInfo loottableinfo) { public void fillInventory(IInventory iinventory, LootTableInfo loottableinfo) {

View File

@ -1,19 +1,12 @@
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -9,6 +9,8 @@ @@ -55,6 +55,18 @@
import com.mojang.authlib.GameProfileRepository;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.datafixers.DataFixer;
+import com.mojang.serialization.DynamicOps;
+import com.mojang.serialization.Lifecycle;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.buffer.Unpooled;
@@ -54,6 +56,15 @@
import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import com.mojang.serialization.DynamicOps;
+import com.mojang.serialization.Lifecycle;
+import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableSet;
+import jline.console.ConsoleReader; +import jline.console.ConsoleReader;
+import joptsimple.OptionSet; +import joptsimple.OptionSet;
@ -22,10 +15,11 @@
+import org.bukkit.craftbukkit.Main; +import org.bukkit.craftbukkit.Main;
+import org.bukkit.event.server.ServerLoadEvent; +import org.bukkit.event.server.ServerLoadEvent;
+// CraftBukkit end +// CraftBukkit end
+
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable { public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
@@ -124,6 +135,20 @@ public static final Logger LOGGER = LogManager.getLogger();
@@ -124,6 +136,20 @@
private final DefinedStructureManager ak; private final DefinedStructureManager ak;
protected SaveData saveData; protected SaveData saveData;
@ -46,7 +40,7 @@
public static <S extends MinecraftServer> S a(Function<Thread, S> function) { public static <S extends MinecraftServer> S a(Function<Thread, S> function) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new Thread(() -> { Thread thread = new Thread(() -> {
@@ -133,21 +158,21 @@ @@ -133,21 +159,21 @@
thread.setUncaughtExceptionHandler((thread1, throwable) -> { thread.setUncaughtExceptionHandler((thread1, throwable) -> {
MinecraftServer.LOGGER.error(throwable); MinecraftServer.LOGGER.error(throwable);
}); });
@ -71,7 +65,7 @@
this.isRunning = true; this.isRunning = true;
this.h = new long[100]; this.h = new long[100];
this.K = ""; this.K = "";
@@ -173,7 +198,34 @@ @@ -173,7 +199,34 @@
this.ak = new DefinedStructureManager(datapackresources.h(), convertable_conversionsession, datafixer); this.ak = new DefinedStructureManager(datapackresources.h(), convertable_conversionsession, datafixer);
this.serverThread = thread; this.serverThread = thread;
this.executorService = SystemUtils.f(); this.executorService = SystemUtils.f();
@ -106,7 +100,7 @@
private void initializeScoreboards(WorldPersistentData worldpersistentdata) { private void initializeScoreboards(WorldPersistentData worldpersistentdata) {
PersistentScoreboard persistentscoreboard = (PersistentScoreboard) worldpersistentdata.a(PersistentScoreboard::new, "scoreboard"); PersistentScoreboard persistentscoreboard = (PersistentScoreboard) worldpersistentdata.a(PersistentScoreboard::new, "scoreboard");
@@ -186,7 +238,7 @@ @@ -186,7 +239,7 @@
public static void convertWorld(Convertable.ConversionSession convertable_conversionsession) { public static void convertWorld(Convertable.ConversionSession convertable_conversionsession) {
if (convertable_conversionsession.isConvertable()) { if (convertable_conversionsession.isConvertable()) {
@ -115,7 +109,7 @@
convertable_conversionsession.convert(new IProgressUpdate() { convertable_conversionsession.convert(new IProgressUpdate() {
private long a = SystemUtils.getMonotonicMillis(); private long a = SystemUtils.getMonotonicMillis();
@@ -209,45 +261,184 @@ @@ -209,45 +262,184 @@
} }
@ -199,7 +193,8 @@
+ } + }
+ MinecraftServer.convertWorld(worldSession); // Run conversion now + MinecraftServer.convertWorld(worldSession); // Run conversion now
+ } + }
+
- this.a(worldloadlistener);
+ org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name); + org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name);
+ +
+ IRegistryCustom.Dimension iregistrycustom_dimension = this.customRegistry; + IRegistryCustom.Dimension iregistrycustom_dimension = this.customRegistry;
@ -251,8 +246,7 @@
+ } + }
+ +
+ ResourceKey<World> worldKey = ResourceKey.a(IRegistry.L, dimensionKey.a()); + ResourceKey<World> worldKey = ResourceKey.a(IRegistry.L, dimensionKey.a());
+
- this.a(worldloadlistener);
+ if (worldId == 0) { + if (worldId == 0) {
+ this.saveData = worlddata; + this.saveData = worlddata;
+ this.saveData.setGameType(((DedicatedServer) this).getDedicatedServerProperties().gamemode); // From DedicatedServer.init + this.saveData.setGameType(((DedicatedServer) this).getDedicatedServerProperties().gamemode); // From DedicatedServer.init
@ -331,7 +325,7 @@
WorldBorder worldborder = worldserver.getWorldBorder(); WorldBorder worldborder = worldserver.getWorldBorder();
worldborder.a(iworlddataserver.r()); worldborder.a(iworlddataserver.r());
@@ -272,31 +463,8 @@ @@ -272,31 +464,8 @@
iworlddataserver.c(true); iworlddataserver.c(true);
} }
@ -364,7 +358,7 @@
private static void a(WorldServer worldserver, IWorldDataServer iworlddataserver, boolean flag, boolean flag1, boolean flag2) { private static void a(WorldServer worldserver, IWorldDataServer iworlddataserver, boolean flag, boolean flag1, boolean flag2) {
ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator(); ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator();
@@ -312,6 +480,21 @@ @@ -312,6 +481,21 @@
return biomebase.b().b(); return biomebase.b().b();
}, random); }, random);
ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition); ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
@ -386,7 +380,7 @@
if (blockposition == null) { if (blockposition == null) {
MinecraftServer.LOGGER.warn("Unable to find spawn biome"); MinecraftServer.LOGGER.warn("Unable to find spawn biome");
@@ -378,8 +561,15 @@ @@ -378,8 +562,15 @@
iworlddataserver.setGameType(EnumGamemode.SPECTATOR); iworlddataserver.setGameType(EnumGamemode.SPECTATOR);
} }
@ -404,7 +398,7 @@
MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.getDimensionKey().a()); MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.getDimensionKey().a());
BlockPosition blockposition = worldserver.getSpawn(); BlockPosition blockposition = worldserver.getSpawn();
@@ -392,17 +582,21 @@ @@ -392,17 +583,21 @@
chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE); chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
while (chunkproviderserver.b() != 441) { while (chunkproviderserver.b() != 441) {
@ -435,7 +429,7 @@
if (forcedchunk != null) { if (forcedchunk != null) {
LongIterator longiterator = forcedchunk.a().iterator(); LongIterator longiterator = forcedchunk.a().iterator();
@@ -416,11 +610,18 @@ @@ -416,11 +611,18 @@
} }
} }
@ -457,7 +451,7 @@
} }
protected void loadResourcesZip() { protected void loadResourcesZip() {
@@ -465,12 +666,16 @@ @@ -465,12 +667,16 @@
worldserver.save((IProgressUpdate) null, flag1, worldserver.savingDisabled && !flag2); worldserver.save((IProgressUpdate) null, flag1, worldserver.savingDisabled && !flag2);
} }
@ -474,7 +468,7 @@
return flag3; return flag3;
} }
@@ -479,8 +684,29 @@ @@ -479,8 +685,29 @@
this.stop(); this.stop();
} }
@ -504,7 +498,7 @@
if (this.getServerConnection() != null) { if (this.getServerConnection() != null) {
this.getServerConnection().b(); this.getServerConnection().b();
} }
@@ -489,6 +715,7 @@ @@ -489,6 +716,7 @@
MinecraftServer.LOGGER.info("Saving players"); MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers(); this.playerList.savePlayers();
this.playerList.shutdown(); this.playerList.shutdown();
@ -512,7 +506,7 @@
} }
MinecraftServer.LOGGER.info("Saving worlds"); MinecraftServer.LOGGER.info("Saving worlds");
@@ -566,14 +793,16 @@ @@ -566,14 +794,16 @@
while (this.isRunning) { while (this.isRunning) {
long i = SystemUtils.getMonotonicMillis() - this.nextTick; long i = SystemUtils.getMonotonicMillis() - this.nextTick;
@ -530,7 +524,7 @@
this.nextTick += 50L; this.nextTick += 50L;
GameProfilerTick gameprofilertick = GameProfilerTick.a("Server"); GameProfilerTick gameprofilertick = GameProfilerTick.a("Server");
@@ -619,6 +848,12 @@ @@ -619,6 +849,12 @@
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1); MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally { } finally {
@ -543,7 +537,7 @@
this.exit(); this.exit();
} }
@@ -627,8 +862,15 @@ @@ -627,8 +863,15 @@
} }
private boolean canSleepForTick() { private boolean canSleepForTick() {
@ -560,7 +554,7 @@
protected void sleepForTick() { protected void sleepForTick() {
this.executeAll(); this.executeAll();
@@ -734,7 +976,7 @@ @@ -734,7 +977,7 @@
this.serverPing.b().a(agameprofile); this.serverPing.b().a(agameprofile);
} }
@ -569,7 +563,7 @@
MinecraftServer.LOGGER.debug("Autosave started"); MinecraftServer.LOGGER.debug("Autosave started");
this.methodProfiler.enter("save"); this.methodProfiler.enter("save");
this.playerList.savePlayers(); this.playerList.savePlayers();
@@ -764,22 +1006,39 @@ @@ -764,22 +1007,39 @@
} }
protected void b(BooleanSupplier booleansupplier) { protected void b(BooleanSupplier booleansupplier) {
@ -609,7 +603,7 @@
this.methodProfiler.enter("tick"); this.methodProfiler.enter("tick");
@@ -863,7 +1122,7 @@ @@ -863,7 +1123,7 @@
} }
public String getServerModName() { public String getServerModName() {
@ -618,7 +612,7 @@
} }
public CrashReport b(CrashReport crashreport) { public CrashReport b(CrashReport crashreport) {
@@ -1220,16 +1479,17 @@ @@ -1220,16 +1480,17 @@
public CompletableFuture<Void> a(Collection<String> collection) { public CompletableFuture<Void> a(Collection<String> collection) {
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> { CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
@ -638,7 +632,7 @@
this.resourcePackRepository.a(collection); this.resourcePackRepository.a(collection);
this.saveData.a(a(this.resourcePackRepository)); this.saveData.a(a(this.resourcePackRepository));
datapackresources.i(); datapackresources.i();
@@ -1595,6 +1855,22 @@ @@ -1595,6 +1856,22 @@
} }

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/PathfinderGoalFollowOwner.java --- a/net/minecraft/server/PathfinderGoalFollowOwner.java
+++ b/net/minecraft/server/PathfinderGoalFollowOwner.java +++ b/net/minecraft/server/PathfinderGoalFollowOwner.java
@@ -1,6 +1,11 @@ @@ -2,6 +2,12 @@
package net.minecraft.server;
import java.util.EnumSet; import java.util.EnumSet;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftEntity; +import org.bukkit.craftbukkit.entity.CraftEntity;
+import org.bukkit.event.entity.EntityTeleportEvent; +import org.bukkit.event.entity.EntityTeleportEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class PathfinderGoalFollowOwner extends PathfinderGoal { public class PathfinderGoalFollowOwner extends PathfinderGoal {
@@ -104,7 +109,18 @@ private final EntityTameableAnimal a;
@@ -104,7 +110,18 @@
} else if (!this.a(new BlockPosition(i, j, k))) { } else if (!this.a(new BlockPosition(i, j, k))) {
return false; return false;
} else { } else {

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/PathfinderGoalRemoveBlock.java --- a/net/minecraft/server/PathfinderGoalRemoveBlock.java
+++ b/net/minecraft/server/PathfinderGoalRemoveBlock.java +++ b/net/minecraft/server/PathfinderGoalRemoveBlock.java
@@ -2,6 +2,10 @@ @@ -3,6 +3,11 @@
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.event.entity.EntityInteractEvent; +import org.bukkit.event.entity.EntityInteractEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
@@ -81,6 +85,14 @@ private final Block g;
@@ -81,6 +86,14 @@
} }
if (this.i > 60) { if (this.i > 60) {

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/PathfinderGoalTarget.java --- a/net/minecraft/server/PathfinderGoalTarget.java
+++ b/net/minecraft/server/PathfinderGoalTarget.java +++ b/net/minecraft/server/PathfinderGoalTarget.java
@@ -1,6 +1,7 @@ @@ -2,6 +2,8 @@
package net.minecraft.server;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
+
public abstract class PathfinderGoalTarget extends PathfinderGoal { public abstract class PathfinderGoalTarget extends PathfinderGoal {
@@ -59,7 +60,7 @@ protected final EntityInsentient e;
@@ -59,7 +61,7 @@
if (entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.isInvulnerable) { if (entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.isInvulnerable) {
return false; return false;
} else { } else {
@ -17,7 +18,7 @@
return true; return true;
} }
} }
@@ -80,7 +81,7 @@ @@ -80,7 +82,7 @@
@Override @Override
public void d() { public void d() {

View File

@ -1,19 +1,20 @@
--- a/net/minecraft/server/PathfinderGoalTempt.java --- a/net/minecraft/server/PathfinderGoalTempt.java
+++ b/net/minecraft/server/PathfinderGoalTempt.java +++ b/net/minecraft/server/PathfinderGoalTempt.java
@@ -1,6 +1,12 @@ @@ -2,6 +2,13 @@
package net.minecraft.server;
import java.util.EnumSet; import java.util.EnumSet;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.EntityTargetEvent;
+import org.bukkit.event.entity.EntityTargetLivingEntityEvent; +import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class PathfinderGoalTempt extends PathfinderGoal { public class PathfinderGoalTempt extends PathfinderGoal {
@@ -12,7 +18,7 @@ private static final PathfinderTargetCondition c = (new PathfinderTargetCondition()).a(10.0D).a().b().d().c();
@@ -12,7 +19,7 @@
private double g; private double g;
private double h; private double h;
private double i; private double i;
@ -22,7 +23,7 @@
private int j; private int j;
private boolean k; private boolean k;
private final RecipeItemStack l; private final RecipeItemStack l;
@@ -40,7 +46,17 @@ @@ -40,7 +47,17 @@
return false; return false;
} else { } else {
this.target = this.a.world.a(PathfinderGoalTempt.c, (EntityLiving) this.a); this.target = this.a.world.a(PathfinderGoalTempt.c, (EntityLiving) this.a);

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/PlayerChunkMap.java --- a/net/minecraft/server/PlayerChunkMap.java
+++ b/net/minecraft/server/PlayerChunkMap.java +++ b/net/minecraft/server/PlayerChunkMap.java
@@ -44,6 +44,7 @@ @@ -45,6 +45,8 @@
import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+import org.bukkit.entity.Player; // CraftBukkit
+import org.bukkit.entity.Player; // CraftBukkit
+
public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -75,6 +76,31 @@ private static final Logger LOGGER = LogManager.getLogger();
@@ -75,6 +77,31 @@
private final Queue<Runnable> A; private final Queue<Runnable> A;
private int viewDistance; private int viewDistance;
@ -40,7 +41,7 @@
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) { public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag); super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
this.visibleChunks = this.updatingChunks.clone(); this.visibleChunks = this.updatingChunks.clone();
@@ -195,9 +221,12 @@ @@ -195,9 +222,12 @@
return completablefuture1.thenApply((list1) -> { return completablefuture1.thenApply((list1) -> {
List<IChunkAccess> list2 = Lists.newArrayList(); List<IChunkAccess> list2 = Lists.newArrayList();
@ -55,7 +56,7 @@
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next(); final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
Optional<IChunkAccess> optional = either.left(); Optional<IChunkAccess> optional = either.left();
@@ -300,7 +329,7 @@ @@ -300,7 +330,7 @@
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName()); PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName());
} else { } else {
this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> { this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
@ -64,7 +65,7 @@
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) { if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
this.saveChunk(ichunkaccess); this.saveChunk(ichunkaccess);
@@ -311,7 +340,6 @@ @@ -311,7 +341,6 @@
} }
} }
@ -72,7 +73,7 @@
protected void unloadChunks(BooleanSupplier booleansupplier) { protected void unloadChunks(BooleanSupplier booleansupplier) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@@ -350,7 +378,7 @@ @@ -350,7 +379,7 @@
private void a(long i, PlayerChunk playerchunk) { private void a(long i, PlayerChunk playerchunk) {
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave(); CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave();
@ -81,7 +82,7 @@
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkSave(); CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkSave();
if (completablefuture1 != completablefuture) { if (completablefuture1 != completablefuture) {
@@ -572,8 +600,15 @@ @@ -572,8 +601,15 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -98,7 +99,7 @@
if (list == null) { if (list == null) {
list = Lists.newArrayList(new Entity[]{entity}); list = Lists.newArrayList(new Entity[]{entity});
} else { } else {
@@ -784,7 +819,8 @@ @@ -784,7 +820,8 @@
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty(); return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
}); });
@ -108,7 +109,7 @@
return Stream.of(chunk.getEntitySlices()).mapToInt(EntitySlice::size).sum(); return Stream.of(chunk.getEntitySlices()).mapToInt(EntitySlice::size).sum();
}).orElse(0), optional1.map((chunk) -> { }).orElse(0), optional1.map((chunk) -> {
return chunk.getTileEntities().size(); return chunk.getTileEntities().size();
@@ -795,7 +831,7 @@ @@ -795,7 +832,7 @@
private static String a(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) { private static String a(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
try { try {
@ -117,7 +118,7 @@
return either != null ? (String) either.map((chunk) -> { return either != null ? (String) either.map((chunk) -> {
return "done"; return "done";
@@ -813,7 +849,7 @@ @@ -813,7 +850,7 @@
private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair); NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
@ -126,7 +127,7 @@
} }
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) { boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
@@ -1145,7 +1181,7 @@ @@ -1145,7 +1182,7 @@
public final Set<EntityPlayer> trackedPlayers = Sets.newHashSet(); public final Set<EntityPlayer> trackedPlayers = Sets.newHashSet();
public EntityTracker(Entity entity, int i, int j, boolean flag) { public EntityTracker(Entity entity, int i, int j, boolean flag) {
@ -135,7 +136,7 @@
this.tracker = entity; this.tracker = entity;
this.trackingDistance = i; this.trackingDistance = i;
this.e = SectionPosition.a(entity); this.e = SectionPosition.a(entity);
@@ -1198,7 +1234,7 @@ @@ -1198,7 +1235,7 @@
public void updatePlayer(EntityPlayer entityplayer) { public void updatePlayer(EntityPlayer entityplayer) {
if (entityplayer != this.tracker) { if (entityplayer != this.tracker) {
@ -144,7 +145,7 @@
int i = Math.min(this.b(), (PlayerChunkMap.this.viewDistance - 1) * 16); int i = Math.min(this.b(), (PlayerChunkMap.this.viewDistance - 1) * 16);
boolean flag = vec3d.x >= (double) (-i) && vec3d.x <= (double) i && vec3d.z >= (double) (-i) && vec3d.z <= (double) i && this.tracker.a(entityplayer); boolean flag = vec3d.x >= (double) (-i) && vec3d.x <= (double) i && vec3d.z >= (double) (-i) && vec3d.z <= (double) i && this.tracker.a(entityplayer);
@@ -1214,6 +1250,17 @@ @@ -1214,6 +1251,17 @@
} }
} }

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/PlayerInteractManager.java --- a/net/minecraft/server/PlayerInteractManager.java
+++ b/net/minecraft/server/PlayerInteractManager.java +++ b/net/minecraft/server/PlayerInteractManager.java
@@ -3,6 +3,15 @@ @@ -4,6 +4,16 @@
import java.util.Objects;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import java.util.ArrayList; +import java.util.ArrayList;
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
@ -13,10 +13,11 @@
+import org.bukkit.event.block.Action; +import org.bukkit.event.block.Action;
+import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerInteractEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class PlayerInteractManager { public class PlayerInteractManager {
@@ -38,7 +47,7 @@ private static final Logger LOGGER = LogManager.getLogger();
@@ -38,7 +48,7 @@
this.gamemode = enumgamemode; this.gamemode = enumgamemode;
enumgamemode.a(this.player.abilities); enumgamemode.a(this.player.abilities);
this.player.updateAbilities(); this.player.updateAbilities();
@ -25,7 +26,7 @@
this.world.everyoneSleeping(); this.world.everyoneSleeping();
} }
@@ -67,7 +76,7 @@ @@ -67,7 +77,7 @@
} }
public void a() { public void a() {
@ -34,7 +35,7 @@
IBlockData iblockdata; IBlockData iblockdata;
if (this.j) { if (this.j) {
@@ -123,9 +132,31 @@ @@ -123,9 +133,31 @@
if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) { if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) {
if (!this.world.a((EntityHuman) this.player, blockposition)) { if (!this.world.a((EntityHuman) this.player, blockposition)) {
@ -66,7 +67,7 @@
if (this.isCreative()) { if (this.isCreative()) {
this.a(blockposition, packetplayinblockdig_enumplayerdigtype, "creative destroy"); this.a(blockposition, packetplayinblockdig_enumplayerdigtype, "creative destroy");
@@ -141,11 +172,43 @@ @@ -141,11 +173,43 @@
float f = 1.0F; float f = 1.0F;
iblockdata = this.world.getType(blockposition); iblockdata = this.world.getType(blockposition);
@ -111,7 +112,7 @@
if (!iblockdata.isAir() && f >= 1.0F) { if (!iblockdata.isAir() && f >= 1.0F) {
this.a(blockposition, packetplayinblockdig_enumplayerdigtype, "insta mine"); this.a(blockposition, packetplayinblockdig_enumplayerdigtype, "insta mine");
} else { } else {
@@ -189,7 +252,7 @@ @@ -189,7 +253,7 @@
} else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) { } else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {
this.f = false; this.f = false;
if (!Objects.equals(this.h, blockposition)) { if (!Objects.equals(this.h, blockposition)) {
@ -120,7 +121,7 @@
this.world.a(this.player.getId(), this.h, -1); this.world.a(this.player.getId(), this.h, -1);
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.h, this.world.getType(this.h), packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying")); this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.h, this.world.getType(this.h), packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying"));
} }
@@ -205,17 +268,73 @@ @@ -205,17 +269,73 @@
if (this.breakBlock(blockposition)) { if (this.breakBlock(blockposition)) {
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true, s)); this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true, s));
} else { } else {
@ -196,7 +197,7 @@
TileEntity tileentity = this.world.getTileEntity(blockposition); TileEntity tileentity = this.world.getTileEntity(blockposition);
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
@@ -225,6 +344,10 @@ @@ -225,6 +345,10 @@
} else if (this.player.a((World) this.world, blockposition, this.gamemode)) { } else if (this.player.a((World) this.world, blockposition, this.gamemode)) {
return false; return false;
} else { } else {
@ -207,7 +208,7 @@
block.a((World) this.world, blockposition, iblockdata, (EntityHuman) this.player); block.a((World) this.world, blockposition, iblockdata, (EntityHuman) this.player);
boolean flag = this.world.a(blockposition, false); boolean flag = this.world.a(blockposition, false);
@@ -233,19 +356,32 @@ @@ -233,19 +357,32 @@
} }
if (this.isCreative()) { if (this.isCreative()) {
@ -243,7 +244,7 @@
} }
} }
} }
@@ -287,12 +423,46 @@ @@ -287,12 +424,46 @@
} }
} }
@ -290,7 +291,7 @@
if (itileinventory != null) { if (itileinventory != null) {
entityplayer.openContainer(itileinventory); entityplayer.openContainer(itileinventory);
@@ -306,7 +476,7 @@ @@ -306,7 +477,7 @@
ItemStack itemstack1 = itemstack.cloneItemStack(); ItemStack itemstack1 = itemstack.cloneItemStack();
if (!flag1) { if (!flag1) {
@ -299,7 +300,7 @@
if (enuminteractionresult.a()) { if (enuminteractionresult.a()) {
CriterionTriggers.M.a(entityplayer, blockposition, itemstack1); CriterionTriggers.M.a(entityplayer, blockposition, itemstack1);
@@ -314,17 +484,17 @@ @@ -314,17 +485,17 @@
} }
} }
@ -320,7 +321,7 @@
} }
if (enuminteractionresult1.a()) { if (enuminteractionresult1.a()) {
@@ -332,10 +502,10 @@ @@ -332,10 +503,10 @@
} }
return enuminteractionresult1; return enuminteractionresult1;

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/PlayerList.java --- a/net/minecraft/server/PlayerList.java
+++ b/net/minecraft/server/PlayerList.java +++ b/net/minecraft/server/PlayerList.java
@@ -21,6 +21,27 @@ @@ -21,6 +21,23 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -11,24 +11,20 @@
+import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.CraftWorld;
+ +
+import org.bukkit.Bukkit;
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.craftbukkit.util.CraftChatMessage; +import org.bukkit.craftbukkit.util.CraftChatMessage;
+import org.bukkit.entity.Player; +import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerChangedWorldEvent; +import org.bukkit.event.player.PlayerChangedWorldEvent;
+import org.bukkit.event.player.PlayerPortalEvent;
+import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerJoinEvent;
+import org.bukkit.event.player.PlayerLoginEvent; +import org.bukkit.event.player.PlayerLoginEvent;
+import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerQuitEvent;
+import org.bukkit.event.player.PlayerRespawnEvent; +import org.bukkit.event.player.PlayerRespawnEvent;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
+import org.bukkit.util.Vector;
+// CraftBukkit end +// CraftBukkit end
+ +
public abstract class PlayerList { public abstract class PlayerList {
public static final File b = new File("banned-players.json"); public static final File b = new File("banned-players.json");
@@ -30,14 +51,16 @@ @@ -30,14 +47,16 @@
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
private static final SimpleDateFormat g = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z"); private static final SimpleDateFormat g = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
private final MinecraftServer server; private final MinecraftServer server;
@ -48,7 +44,7 @@
public final WorldNBTStorage playerFileData; public final WorldNBTStorage playerFileData;
private boolean hasWhitelist; private boolean hasWhitelist;
private final IRegistryCustom.Dimension s; private final IRegistryCustom.Dimension s;
@@ -47,13 +70,23 @@ @@ -47,13 +66,23 @@
private boolean v; private boolean v;
private int w; private int w;
@ -74,7 +70,7 @@
this.server = minecraftserver; this.server = minecraftserver;
this.s = iregistrycustom_dimension; this.s = iregistrycustom_dimension;
this.maxPlayers = i; this.maxPlayers = i;
@@ -69,6 +102,12 @@ @@ -69,6 +98,12 @@
usercache.a(gameprofile); usercache.a(gameprofile);
NBTTagCompound nbttagcompound = this.a(entityplayer); NBTTagCompound nbttagcompound = this.a(entityplayer);
ResourceKey resourcekey; ResourceKey resourcekey;
@ -87,7 +83,7 @@
if (nbttagcompound != null) { if (nbttagcompound != null) {
DataResult dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.a, nbttagcompound.get("Dimension"))); DataResult dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.a, nbttagcompound.get("Dimension")));
@@ -99,7 +138,8 @@ @@ -99,7 +134,8 @@
s1 = networkmanager.getSocketAddress().toString(); s1 = networkmanager.getSocketAddress().toString();
} }
@ -97,7 +93,7 @@
WorldData worlddata = worldserver1.getWorldData(); WorldData worlddata = worldserver1.getWorldData();
this.a(entityplayer, (EntityPlayer) null, worldserver1); this.a(entityplayer, (EntityPlayer) null, worldserver1);
@@ -109,6 +149,7 @@ @@ -109,6 +145,7 @@
boolean flag1 = gamerules.getBoolean(GameRules.REDUCED_DEBUG_INFO); boolean flag1 = gamerules.getBoolean(GameRules.REDUCED_DEBUG_INFO);
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.F(), this.s, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), this.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld())); playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.F(), this.s, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), this.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld()));
@ -105,7 +101,7 @@
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities)); playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities));
@@ -127,19 +168,61 @@ @@ -127,19 +164,61 @@
} else { } else {
chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[]{entityplayer.getScoreboardDisplayName(), s}); chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[]{entityplayer.getScoreboardDisplayName(), s});
} }
@ -172,7 +168,7 @@
this.a(entityplayer, worldserver1); this.a(entityplayer, worldserver1);
if (!this.server.getResourcePack().isEmpty()) { if (!this.server.getResourcePack().isEmpty()) {
entityplayer.setResourcePack(this.server.getResourcePack(), this.server.getResourcePackHash()); entityplayer.setResourcePack(this.server.getResourcePack(), this.server.getResourcePackHash());
@@ -155,8 +238,11 @@ @@ -155,8 +234,11 @@
if (nbttagcompound != null && nbttagcompound.hasKeyOfType("RootVehicle", 10)) { if (nbttagcompound != null && nbttagcompound.hasKeyOfType("RootVehicle", 10)) {
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RootVehicle"); NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");
@ -186,7 +182,7 @@
}); });
if (entity != null) { if (entity != null) {
@@ -199,6 +285,8 @@ @@ -199,6 +281,8 @@
} }
entityplayer.syncInventory(); entityplayer.syncInventory();
@ -195,7 +191,7 @@
} }
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) { public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
@@ -231,30 +319,31 @@ @@ -231,30 +315,31 @@
} }
public void setPlayerFileData(WorldServer worldserver) { public void setPlayerFileData(WorldServer worldserver) {
@ -232,7 +228,7 @@
} }
@Override @Override
@@ -282,14 +371,15 @@ @@ -282,14 +367,15 @@
} }
protected void savePlayerFile(EntityPlayer entityplayer) { protected void savePlayerFile(EntityPlayer entityplayer) {
@ -250,7 +246,7 @@
if (advancementdataplayer != null) { if (advancementdataplayer != null) {
advancementdataplayer.b(); advancementdataplayer.b();
@@ -297,10 +387,24 @@ @@ -297,10 +383,24 @@
} }
@ -276,7 +272,7 @@
this.savePlayerFile(entityplayer); this.savePlayerFile(entityplayer);
if (entityplayer.isPassenger()) { if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle(); Entity entity = entityplayer.getRootVehicle();
@@ -332,18 +436,66 @@ @@ -332,18 +432,66 @@
if (entityplayer1 == entityplayer) { if (entityplayer1 == entityplayer) {
this.j.remove(uuid); this.j.remove(uuid);
@ -349,7 +345,7 @@
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.k.get(gameprofile); GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.k.get(gameprofile);
chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()}); chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()});
@@ -351,10 +503,12 @@ @@ -351,10 +499,12 @@
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[]{PlayerList.g.format(gameprofilebanentry.getExpires())})); chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[]{PlayerList.g.format(gameprofilebanentry.getExpires())}));
} }
@ -365,7 +361,7 @@
IpBanEntry ipbanentry = this.l.get(socketaddress); IpBanEntry ipbanentry = this.l.get(socketaddress);
chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()}); chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()});
@@ -362,13 +516,25 @@ @@ -362,13 +512,25 @@
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[]{PlayerList.g.format(ipbanentry.getExpires())})); chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[]{PlayerList.g.format(ipbanentry.getExpires())}));
} }
@ -394,7 +390,7 @@
UUID uuid = EntityHuman.a(gameprofile); UUID uuid = EntityHuman.a(gameprofile);
List<EntityPlayer> list = Lists.newArrayList(); List<EntityPlayer> list = Lists.newArrayList();
@@ -404,14 +570,24 @@ @@ -404,14 +566,24 @@
} }
return new EntityPlayer(this.server, worldserver, gameprofile, (PlayerInteractManager) object); return new EntityPlayer(this.server, worldserver, gameprofile, (PlayerInteractManager) object);
@ -419,7 +415,7 @@
WorldServer worldserver = this.server.getWorldServer(entityplayer.getSpawnDimension()); WorldServer worldserver = this.server.getWorldServer(entityplayer.getSpawnDimension());
Optional optional; Optional optional;
@@ -431,6 +607,11 @@ @@ -431,6 +603,11 @@
} }
EntityPlayer entityplayer1 = new EntityPlayer(this.server, worldserver1, entityplayer.getProfile(), (PlayerInteractManager) object); EntityPlayer entityplayer1 = new EntityPlayer(this.server, worldserver1, entityplayer.getProfile(), (PlayerInteractManager) object);
@ -431,7 +427,7 @@
entityplayer1.playerConnection = entityplayer.playerConnection; entityplayer1.playerConnection = entityplayer.playerConnection;
entityplayer1.copyFrom(entityplayer, flag); entityplayer1.copyFrom(entityplayer, flag);
@@ -444,52 +625,113 @@ @@ -444,52 +621,113 @@
entityplayer1.addScoreboardTag(s); entityplayer1.addScoreboardTag(s);
} }
@ -570,7 +566,7 @@
return entityplayer1; return entityplayer1;
} }
@@ -502,7 +744,18 @@ @@ -502,7 +740,18 @@
public void tick() { public void tick() {
if (++this.w > 600) { if (++this.w > 600) {
@ -590,7 +586,7 @@
this.w = 0; this.w = 0;
} }
@@ -515,6 +768,25 @@ @@ -515,6 +764,25 @@
} }
@ -616,7 +612,7 @@
public void a(Packet<?> packet, ResourceKey<World> resourcekey) { public void a(Packet<?> packet, ResourceKey<World> resourcekey) {
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
@@ -615,6 +887,7 @@ @@ -615,6 +883,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0)); entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0));
} }
@ -624,7 +620,7 @@
this.server.getCommandDispatcher().a(entityplayer); this.server.getCommandDispatcher().a(entityplayer);
} }
@@ -647,6 +920,12 @@ @@ -647,6 +916,12 @@
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
@ -637,7 +633,7 @@
if (entityplayer != entityhuman && entityplayer.world.getDimensionKey() == resourcekey) { if (entityplayer != entityhuman && entityplayer.world.getDimensionKey() == resourcekey) {
double d4 = d0 - entityplayer.locX(); double d4 = d0 - entityplayer.locX();
double d5 = d1 - entityplayer.locY(); double d5 = d1 - entityplayer.locY();
@@ -686,23 +965,34 @@ @@ -686,23 +961,34 @@
public void reloadWhitelist() {} public void reloadWhitelist() {}
public void a(EntityPlayer entityplayer, WorldServer worldserver) { public void a(EntityPlayer entityplayer, WorldServer worldserver) {
@ -677,7 +673,7 @@
} }
public int getPlayerCount() { public int getPlayerCount() {
@@ -755,31 +1045,54 @@ @@ -755,31 +1041,54 @@
entityplayer.playerInteractManager.a(this.u, EnumGamemode.NOT_SET); entityplayer.playerInteractManager.a(this.u, EnumGamemode.NOT_SET);
} }
@ -740,7 +736,7 @@
if (file2.exists() && file2.isFile()) { if (file2.exists() && file2.isFile()) {
file2.renameTo(file1); file2.renameTo(file1);
@@ -787,7 +1100,7 @@ @@ -787,7 +1096,7 @@
} }
serverstatisticmanager = new ServerStatisticManager(this.server, file1); serverstatisticmanager = new ServerStatisticManager(this.server, file1);
@ -749,7 +745,7 @@
} }
return serverstatisticmanager; return serverstatisticmanager;
@@ -795,14 +1108,14 @@ @@ -795,14 +1104,14 @@
public AdvancementDataPlayer f(EntityPlayer entityplayer) { public AdvancementDataPlayer f(EntityPlayer entityplayer) {
UUID uuid = entityplayer.getUniqueID(); UUID uuid = entityplayer.getUniqueID();
@ -766,7 +762,7 @@
} }
advancementdataplayer.a(entityplayer); advancementdataplayer.a(entityplayer);
@@ -838,13 +1151,20 @@ @@ -838,13 +1147,20 @@
} }
public void reload() { public void reload() {

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/RecipeBookServer.java --- a/net/minecraft/server/RecipeBookServer.java
+++ b/net/minecraft/server/RecipeBookServer.java +++ b/net/minecraft/server/RecipeBookServer.java
@@ -9,6 +9,7 @@ @@ -10,6 +10,8 @@
import java.util.function.Consumer;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class RecipeBookServer extends RecipeBook { public class RecipeBookServer extends RecipeBook {
@@ -25,7 +26,7 @@ private static final Logger LOGGER = LogManager.getLogger();
@@ -25,7 +27,7 @@
IRecipe<?> irecipe = (IRecipe) iterator.next(); IRecipe<?> irecipe = (IRecipe) iterator.next();
MinecraftKey minecraftkey = irecipe.getKey(); MinecraftKey minecraftkey = irecipe.getKey();
@ -17,7 +18,7 @@
this.a(minecraftkey); this.a(minecraftkey);
this.d(minecraftkey); this.d(minecraftkey);
list.add(minecraftkey); list.add(minecraftkey);
@@ -59,6 +60,7 @@ @@ -59,6 +61,7 @@
} }
private void a(PacketPlayOutRecipes.Action packetplayoutrecipes_action, EntityPlayer entityplayer, List<MinecraftKey> list) { private void a(PacketPlayOutRecipes.Action packetplayoutrecipes_action, EntityPlayer entityplayer, List<MinecraftKey> list) {

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/RecipeSmithing.java --- a/net/minecraft/server/RecipeSmithing.java
+++ b/net/minecraft/server/RecipeSmithing.java +++ b/net/minecraft/server/RecipeSmithing.java
@@ -2,6 +2,13 @@ @@ -3,6 +3,14 @@
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe; +import org.bukkit.craftbukkit.inventory.CraftRecipe;
@ -11,10 +11,11 @@
+import org.bukkit.craftbukkit.util.CraftNamespacedKey; +import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.inventory.Recipe; +import org.bukkit.inventory.Recipe;
+// CraftBukkit end +// CraftBukkit end
+
public class RecipeSmithing implements IRecipe<IInventory> { public class RecipeSmithing implements IRecipe<IInventory> {
@@ -58,6 +65,17 @@ private final RecipeItemStack a;
@@ -58,6 +66,17 @@
return Recipes.SMITHING; return Recipes.SMITHING;
} }

View File

@ -1,22 +1,20 @@
--- 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,15 @@ @@ -13,6 +13,13 @@
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
+// CraftBukkit start +// CraftBukkit start
+import java.util.ArrayList;
+import java.util.List;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe; +import org.bukkit.craftbukkit.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.inventory.CraftShapedRecipe; +import org.bukkit.craftbukkit.inventory.CraftShapedRecipe;
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.inventory.RecipeChoice; +import org.bukkit.inventory.RecipeChoice;
+// CraftBukkit end +// CraftBukkit end
+
public class ShapedRecipes implements RecipeCrafting { public class ShapedRecipes implements RecipeCrafting {
@@ -31,6 +40,66 @@ private final int width;
@@ -31,6 +38,66 @@
this.result = itemstack; this.result = itemstack;
} }

View File

@ -1,18 +1,19 @@
--- 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,11 @@ @@ -6,6 +6,12 @@
import com.google.gson.JsonParseException;
import it.unimi.dsi.fastutil.ints.IntList; import it.unimi.dsi.fastutil.ints.IntList;
import java.util.Iterator; import java.util.Iterator;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe; +import org.bukkit.craftbukkit.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe; +import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
+// CraftBukkit end +// CraftBukkit end
+
public class ShapelessRecipes implements RecipeCrafting { public class ShapelessRecipes implements RecipeCrafting {
@@ -20,6 +25,20 @@ private final MinecraftKey key;
@@ -20,6 +26,20 @@
this.ingredients = nonnulllist; this.ingredients = nonnulllist;
} }

View File

@ -1,15 +1,15 @@
--- a/net/minecraft/server/TileEntity.java --- a/net/minecraft/server/TileEntity.java
+++ b/net/minecraft/server/TileEntity.java +++ b/net/minecraft/server/TileEntity.java
@@ -4,9 +4,18 @@ @@ -5,8 +5,18 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Supplier; import org.apache.logging.log4j.util.Supplier;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer; +import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
+import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry; +import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry;
+import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end +// CraftBukkit end
+
public abstract class TileEntity { public abstract class TileEntity {
+ // CraftBukkit start - data containers + // CraftBukkit start - data containers
@ -19,7 +19,7 @@
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
private final TileEntityTypes<?> tileType; private final TileEntityTypes<?> tileType;
@Nullable @Nullable
@@ -38,6 +47,14 @@ @@ -38,6 +48,14 @@
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) { public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
this.position = new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")); this.position = new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z"));
@ -34,7 +34,7 @@
} }
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
@@ -54,6 +71,11 @@ @@ -54,6 +72,11 @@
nbttagcompound.setInt("x", this.position.getX()); nbttagcompound.setInt("x", this.position.getX());
nbttagcompound.setInt("y", this.position.getY()); nbttagcompound.setInt("y", this.position.getY());
nbttagcompound.setInt("z", this.position.getZ()); nbttagcompound.setInt("z", this.position.getZ());
@ -46,7 +46,7 @@
return nbttagcompound; return nbttagcompound;
} }
} }
@@ -169,4 +191,13 @@ @@ -169,4 +192,13 @@
}, this::getPosition}); }, this::getPosition});
} }
} }

View File

@ -1,19 +1,13 @@
--- a/net/minecraft/server/TileEntityBarrel.java --- a/net/minecraft/server/TileEntityBarrel.java
+++ b/net/minecraft/server/TileEntityBarrel.java +++ b/net/minecraft/server/TileEntityBarrel.java
@@ -1,7 +1,55 @@ @@ -1,7 +1,49 @@
package net.minecraft.server; package net.minecraft.server;
+// CraftBukkit start +// CraftBukkit start
+import java.util.ArrayList; +import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List; +import java.util.List;
+import org.bukkit.Location;
+import org.bukkit.block.Barrel;
+import org.bukkit.block.Lectern;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end +// CraftBukkit end
+ +
public class TileEntityBarrel extends TileEntityLootable { public class TileEntityBarrel extends TileEntityLootable {
@ -56,7 +50,7 @@
private NonNullList<ItemStack> items; private NonNullList<ItemStack> items;
private int b; private int b;
@@ -100,7 +148,7 @@ @@ -100,7 +142,7 @@
return; return;
} }

View File

@ -1,20 +1,18 @@
--- a/net/minecraft/server/TileEntityBeacon.java --- a/net/minecraft/server/TileEntityBeacon.java
+++ b/net/minecraft/server/TileEntityBeacon.java +++ b/net/minecraft/server/TileEntityBeacon.java
@@ -8,6 +8,13 @@ @@ -8,6 +8,11 @@
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.potion.CraftPotionUtil; +import org.bukkit.craftbukkit.potion.CraftPotionUtil;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffect;
+// CraftBukkit end +// CraftBukkit end
+ +
public class TileEntityBeacon extends TileEntity implements ITileInventory, ITickable { public class TileEntityBeacon extends TileEntity implements ITileInventory, ITickable {
public static final MobEffectList[][] a = new MobEffectList[][]{{MobEffects.FASTER_MOVEMENT, MobEffects.FASTER_DIG}, {MobEffects.RESISTANCE, MobEffects.JUMP}, {MobEffects.INCREASE_DAMAGE}, {MobEffects.REGENERATION}}; public static final MobEffectList[][] a = new MobEffectList[][]{{MobEffects.FASTER_MOVEMENT, MobEffects.FASTER_DIG}, {MobEffects.RESISTANCE, MobEffects.JUMP}, {MobEffects.INCREASE_DAMAGE}, {MobEffects.REGENERATION}};
@@ -24,6 +31,15 @@ @@ -24,6 +29,15 @@
public IChatBaseComponent customName; public IChatBaseComponent customName;
public ChestLock chestLock; public ChestLock chestLock;
private final IContainerProperties containerProperties; private final IContainerProperties containerProperties;
@ -30,7 +28,7 @@
public TileEntityBeacon() { public TileEntityBeacon() {
super(TileEntityTypes.BEACON); super(TileEntityTypes.BEACON);
@@ -192,39 +208,78 @@ @@ -192,39 +206,78 @@
super.al_(); super.al_();
} }
@ -119,7 +117,7 @@
public void a(SoundEffect soundeffect) { public void a(SoundEffect soundeffect) {
this.world.playSound((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F); this.world.playSound((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
} }
@@ -254,8 +309,11 @@ @@ -254,8 +307,11 @@
@Override @Override
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) { public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
super.load(iblockdata, nbttagcompound); super.load(iblockdata, nbttagcompound);

View File

@ -1,18 +1,19 @@
--- a/net/minecraft/server/TileEntityCampfire.java --- a/net/minecraft/server/TileEntityCampfire.java
+++ b/net/minecraft/server/TileEntityCampfire.java +++ b/net/minecraft/server/TileEntityCampfire.java
@@ -3,6 +3,11 @@ @@ -4,6 +4,12 @@
import java.util.Optional;
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.block.BlockCookEvent; +import org.bukkit.event.block.BlockCookEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class TileEntityCampfire extends TileEntity implements Clearable, ITickable { public class TileEntityCampfire extends TileEntity implements Clearable, ITickable {
@@ -55,6 +60,20 @@ private final NonNullList<ItemStack> items;
@@ -55,6 +61,20 @@
}).orElse(itemstack); }).orElse(itemstack);
BlockPosition blockposition = this.getPosition(); BlockPosition blockposition = this.getPosition();

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/TileEntityChest.java --- a/net/minecraft/server/TileEntityChest.java
+++ b/net/minecraft/server/TileEntityChest.java +++ b/net/minecraft/server/TileEntityChest.java
@@ -2,6 +2,10 @@ @@ -3,6 +3,11 @@
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+// CraftBukkit end +// CraftBukkit end
+
public class TileEntityChest extends TileEntityLootable implements ITickable { public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -11,6 +15,37 @@ private NonNullList<ItemStack> items;
@@ -11,6 +16,37 @@
public int viewingCount; public int viewingCount;
private int j; private int j;
@ -49,7 +50,7 @@
protected TileEntityChest(TileEntityTypes<?> tileentitytypes) { protected TileEntityChest(TileEntityTypes<?> tileentitytypes) {
super(tileentitytypes); super(tileentitytypes);
this.items = NonNullList.a(27, ItemStack.b); this.items = NonNullList.a(27, ItemStack.b);
@@ -61,6 +96,13 @@ @@ -61,6 +97,13 @@
this.b = this.a; this.b = this.a;
float f = 0.1F; float f = 0.1F;
@ -63,7 +64,7 @@
if (this.viewingCount > 0 && this.a == 0.0F) { if (this.viewingCount > 0 && this.a == 0.0F) {
this.playOpenSound(SoundEffects.BLOCK_CHEST_OPEN); this.playOpenSound(SoundEffects.BLOCK_CHEST_OPEN);
} }
@@ -155,8 +197,20 @@ @@ -155,8 +198,20 @@
if (this.viewingCount < 0) { if (this.viewingCount < 0) {
this.viewingCount = 0; this.viewingCount = 0;
} }
@ -84,7 +85,7 @@
this.onOpen(); this.onOpen();
} }
@@ -165,7 +219,18 @@ @@ -165,7 +220,18 @@
@Override @Override
public void closeContainer(EntityHuman entityhuman) { public void closeContainer(EntityHuman entityhuman) {
if (!entityhuman.isSpectator()) { if (!entityhuman.isSpectator()) {
@ -103,7 +104,7 @@
this.onOpen(); this.onOpen();
} }
@@ -175,7 +240,7 @@ @@ -175,7 +241,7 @@
Block block = this.getBlock().getBlock(); Block block = this.getBlock().getBlock();
if (block instanceof BlockChest) { if (block instanceof BlockChest) {
@ -112,7 +113,7 @@
this.world.applyPhysics(this.position, block); this.world.applyPhysics(this.position, block);
} }
@@ -216,4 +281,11 @@ @@ -216,4 +282,11 @@
protected Container createContainer(int i, PlayerInventory playerinventory) { protected Container createContainer(int i, PlayerInventory playerinventory) {
return ContainerChest.a(i, playerinventory, this); return ContainerChest.a(i, playerinventory, this);
} }

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/TileEntityConduit.java --- a/net/minecraft/server/TileEntityConduit.java
+++ b/net/minecraft/server/TileEntityConduit.java +++ b/net/minecraft/server/TileEntityConduit.java
@@ -6,6 +6,10 @@ @@ -7,6 +7,11 @@
import java.util.Random;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end +// CraftBukkit end
+
public class TileEntityConduit extends TileEntity implements ITickable { public class TileEntityConduit extends TileEntity implements ITickable {
@@ -158,7 +162,7 @@ private static final Block[] b = new Block[]{Blocks.PRISMARINE, Blocks.PRISMARINE_BRICKS, Blocks.SEA_LANTERN, Blocks.DARK_PRISMARINE};
@@ -158,7 +163,7 @@
EntityHuman entityhuman = (EntityHuman) iterator.next(); EntityHuman entityhuman = (EntityHuman) iterator.next();
if (this.position.a((BaseBlockPosition) entityhuman.getChunkCoordinates(), (double) j) && entityhuman.isInWaterOrRain()) { if (this.position.a((BaseBlockPosition) entityhuman.getChunkCoordinates(), (double) j) && entityhuman.isInWaterOrRain()) {
@ -20,7 +21,7 @@
} }
} }
@@ -175,7 +179,7 @@ @@ -175,7 +180,7 @@
this.target = this.x(); this.target = this.x();
this.k = null; this.k = null;
} else if (this.target == null) { } else if (this.target == null) {
@ -29,7 +30,7 @@
return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain(); return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain();
}); });
@@ -187,8 +191,13 @@ @@ -187,8 +192,13 @@
} }
if (this.target != null) { if (this.target != null) {
@ -45,7 +46,7 @@
} }
if (entityliving != this.target) { if (entityliving != this.target) {
@@ -221,7 +230,7 @@ @@ -221,7 +231,7 @@
@Nullable @Nullable
private EntityLiving x() { private EntityLiving x() {

View File

@ -1,16 +1,16 @@
--- a/net/minecraft/server/TileEntityDispenser.java --- a/net/minecraft/server/TileEntityDispenser.java
+++ b/net/minecraft/server/TileEntityDispenser.java +++ b/net/minecraft/server/TileEntityDispenser.java
@@ -1,12 +1,48 @@ @@ -2,11 +2,48 @@
package net.minecraft.server;
import java.util.Random; import java.util.Random;
+// CraftBukkit start +// CraftBukkit start
+import java.util.List; +import java.util.List;
+ +
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+// CraftBukkit end +// CraftBukkit end
+
public class TileEntityDispenser extends TileEntityLootable { public class TileEntityDispenser extends TileEntityLootable {
private static final Random a = new Random(); private static final Random a = new Random();

View File

@ -1,19 +1,20 @@
--- a/net/minecraft/server/TileEntityEndGateway.java --- a/net/minecraft/server/TileEntityEndGateway.java
+++ b/net/minecraft/server/TileEntityEndGateway.java +++ b/net/minecraft/server/TileEntityEndGateway.java
@@ -6,6 +6,12 @@ @@ -7,6 +7,13 @@
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftPlayer; +import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerTeleportEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class TileEntityEndGateway extends TileEntityEnderPortal implements ITickable { public class TileEntityEndGateway extends TileEntityEnderPortal implements ITickable {
@@ -117,7 +123,7 @@ private static final Logger LOGGER = LogManager.getLogger();
@@ -117,7 +124,7 @@
public void b(Entity entity) { public void b(Entity entity) {
if (this.world instanceof WorldServer && !this.f()) { if (this.world instanceof WorldServer && !this.f()) {
this.c = 100; this.c = 100;
@ -22,7 +23,7 @@
this.a((WorldServer) this.world); this.a((WorldServer) this.world);
} }
@@ -142,6 +148,27 @@ @@ -142,6 +149,27 @@
entity1 = entity.getRootVehicle(); entity1 = entity.getRootVehicle();
} }
@ -50,7 +51,7 @@
entity1.resetPortalCooldown(); entity1.resetPortalCooldown();
entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D); entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);
} }
@@ -246,7 +273,7 @@ @@ -246,7 +274,7 @@
} }
private void a(WorldServer worldserver, BlockPosition blockposition) { private void a(WorldServer worldserver, BlockPosition blockposition) {

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/TileEntityFurnace.java --- a/net/minecraft/server/TileEntityFurnace.java
+++ b/net/minecraft/server/TileEntityFurnace.java +++ b/net/minecraft/server/TileEntityFurnace.java
@@ -9,6 +9,16 @@ @@ -10,6 +10,17 @@
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.entity.CraftHumanEntity;
@ -14,10 +14,11 @@
+import org.bukkit.event.inventory.FurnaceExtractEvent; +import org.bukkit.event.inventory.FurnaceExtractEvent;
+import org.bukkit.event.inventory.FurnaceSmeltEvent; +import org.bukkit.event.inventory.FurnaceSmeltEvent;
+// CraftBukkit end +// CraftBukkit end
+
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable { public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable {
@@ -137,6 +147,36 @@ private static final int[] g = new int[]{0};
@@ -137,6 +148,36 @@
return map; return map;
} }
@ -54,7 +55,7 @@
private static boolean b(Item item) { private static boolean b(Item item) {
return TagsItem.NON_FLAMMABLE_WOOD.isTagged(item); return TagsItem.NON_FLAMMABLE_WOOD.isTagged(item);
} }
@@ -223,12 +263,23 @@ @@ -223,12 +264,23 @@
this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal); this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal);
} }
} else { } else {
@ -81,7 +82,7 @@
flag1 = true; flag1 = true;
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
Item item = itemstack.getItem(); Item item = itemstack.getItem();
@@ -290,11 +341,38 @@ @@ -290,11 +342,38 @@
ItemStack itemstack1 = irecipe.getResult(); ItemStack itemstack1 = irecipe.getResult();
ItemStack itemstack2 = (ItemStack) this.items.get(2); ItemStack itemstack2 = (ItemStack) this.items.get(2);
@ -120,7 +121,7 @@
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
this.a(irecipe); this.a(irecipe);
@@ -319,7 +397,7 @@ @@ -319,7 +398,7 @@
} }
protected int getRecipeCookingTime() { protected int getRecipeCookingTime() {
@ -129,7 +130,7 @@
} }
public static boolean isFuel(ItemStack itemstack) { public static boolean isFuel(ItemStack itemstack) {
@@ -446,14 +524,20 @@ @@ -446,14 +525,20 @@
@Override @Override
public void b(EntityHuman entityhuman) {} public void b(EntityHuman entityhuman) {}
@ -152,7 +153,7 @@
List<IRecipe<?>> list = Lists.newArrayList(); List<IRecipe<?>> list = Lists.newArrayList();
ObjectIterator objectiterator = this.n.object2IntEntrySet().iterator(); ObjectIterator objectiterator = this.n.object2IntEntrySet().iterator();
@@ -462,14 +546,14 @@ @@ -462,14 +547,14 @@
world.getCraftingManager().getRecipe((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> { world.getCraftingManager().getRecipe((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
list.add(irecipe); list.add(irecipe);
@ -169,7 +170,7 @@
int j = MathHelper.d((float) i * f); int j = MathHelper.d((float) i * f);
float f1 = MathHelper.h((float) i * f); float f1 = MathHelper.h((float) i * f);
@@ -477,6 +561,14 @@ @@ -477,6 +562,14 @@
++j; ++j;
} }

View File

@ -1,9 +1,10 @@
--- a/net/minecraft/server/TileEntityLectern.java --- a/net/minecraft/server/TileEntityLectern.java
+++ b/net/minecraft/server/TileEntityLectern.java +++ b/net/minecraft/server/TileEntityLectern.java
@@ -1,10 +1,64 @@ @@ -2,9 +2,63 @@
package net.minecraft.server;
import javax.annotation.Nullable; import javax.annotation.Nullable;
-public class TileEntityLectern extends TileEntity implements Clearable, ITileInventory {
+// CraftBukkit start +// CraftBukkit start
+import java.util.ArrayList; +import java.util.ArrayList;
+import java.util.Arrays; +import java.util.Arrays;
@ -11,13 +12,11 @@
+import java.util.UUID; +import java.util.UUID;
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.block.Lectern; +import org.bukkit.block.Lectern;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end +// CraftBukkit end
+
-public class TileEntityLectern extends TileEntity implements Clearable, ITileInventory {
+public class TileEntityLectern extends TileEntity implements Clearable, ITileInventory, ICommandListener { // CraftBukkit - ICommandListener +public class TileEntityLectern extends TileEntity implements Clearable, ITileInventory, ICommandListener { // CraftBukkit - ICommandListener
+ +
+ // CraftBukkit start - add fields and methods + // CraftBukkit start - add fields and methods

View File

@ -1,17 +1,18 @@
--- a/net/minecraft/server/TileEntityShulkerBox.java --- a/net/minecraft/server/TileEntityShulkerBox.java
+++ b/net/minecraft/server/TileEntityShulkerBox.java +++ b/net/minecraft/server/TileEntityShulkerBox.java
@@ -3,6 +3,10 @@ @@ -4,6 +4,11 @@
import java.util.List;
import java.util.stream.IntStream; import java.util.stream.IntStream;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.HumanEntity;
+// CraftBukkit end +// CraftBukkit end
+
public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory, ITickable { public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory, ITickable {
@@ -16,6 +20,37 @@ private static final int[] a = IntStream.range(0, 27).toArray();
@@ -16,6 +21,37 @@
private EnumColor l; private EnumColor l;
private boolean m; private boolean m;
@ -49,7 +50,7 @@
public TileEntityShulkerBox(@Nullable EnumColor enumcolor) { public TileEntityShulkerBox(@Nullable EnumColor enumcolor) {
super(TileEntityTypes.SHULKER_BOX); super(TileEntityTypes.SHULKER_BOX);
this.contents = NonNullList.a(27, ItemStack.b); this.contents = NonNullList.a(27, ItemStack.b);
@@ -178,6 +213,7 @@ @@ -178,6 +214,7 @@
} }
++this.viewingCount; ++this.viewingCount;
@ -57,7 +58,7 @@
this.world.playBlockAction(this.position, this.getBlock().getBlock(), 1, this.viewingCount); this.world.playBlockAction(this.position, this.getBlock().getBlock(), 1, this.viewingCount);
if (this.viewingCount == 1) { if (this.viewingCount == 1) {
this.world.playSound((EntityHuman) null, this.position, SoundEffects.BLOCK_SHULKER_BOX_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); this.world.playSound((EntityHuman) null, this.position, SoundEffects.BLOCK_SHULKER_BOX_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
@@ -190,6 +226,7 @@ @@ -190,6 +227,7 @@
public void closeContainer(EntityHuman entityhuman) { public void closeContainer(EntityHuman entityhuman) {
if (!entityhuman.isSpectator()) { if (!entityhuman.isSpectator()) {
--this.viewingCount; --this.viewingCount;

View File

@ -1,10 +1,7 @@
--- a/net/minecraft/server/TileEntitySign.java --- a/net/minecraft/server/TileEntitySign.java
+++ b/net/minecraft/server/TileEntitySign.java +++ b/net/minecraft/server/TileEntitySign.java
@@ -1,9 +1,10 @@ @@ -3,7 +3,7 @@
package net.minecraft.server;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
+import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
-public class TileEntitySign extends TileEntity { -public class TileEntitySign extends TileEntity {
@ -12,7 +9,7 @@
public final IChatBaseComponent[] lines; public final IChatBaseComponent[] lines;
public boolean isEditable; public boolean isEditable;
@@ -29,6 +30,12 @@ @@ -29,6 +29,12 @@
nbttagcompound.setString("Text" + (i + 1), s); nbttagcompound.setString("Text" + (i + 1), s);
} }
@ -25,7 +22,7 @@
nbttagcompound.setString("Color", this.color.c()); nbttagcompound.setString("Color", this.color.c());
return nbttagcompound; return nbttagcompound;
} }
@@ -39,18 +46,38 @@ @@ -39,18 +45,38 @@
super.load(iblockdata, nbttagcompound); super.load(iblockdata, nbttagcompound);
this.color = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK); this.color = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK);
@ -71,13 +68,13 @@
} }
this.g[i] = null; this.g[i] = null;
@@ -111,11 +138,37 @@ @@ -111,11 +137,37 @@
return true; return true;
} }
+ // CraftBukkit start + // CraftBukkit start
+ @Override + @Override
+ public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) {} + public void sendMessage(IChatBaseComponent ichatbasecomponent, java.util.UUID uuid) {}
+ +
+ @Override + @Override
+ public org.bukkit.command.CommandSender getBukkitSender(CommandListenerWrapper wrapper) { + public org.bukkit.command.CommandSender getBukkitSender(CommandListenerWrapper wrapper) {
@ -110,7 +107,7 @@
} }
public EnumColor getColor() { public EnumColor getColor() {
@@ -126,7 +179,7 @@ @@ -126,7 +178,7 @@
if (enumcolor != this.getColor()) { if (enumcolor != this.getColor()) {
this.color = enumcolor; this.color = enumcolor;
this.update(); this.update();

View File

@ -1,15 +1,15 @@
--- a/net/minecraft/server/WorldDataServer.java --- a/net/minecraft/server/WorldDataServer.java
+++ b/net/minecraft/server/WorldDataServer.java +++ b/net/minecraft/server/WorldDataServer.java
@@ -13,11 +13,16 @@ @@ -14,10 +14,16 @@
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.event.weather.ThunderChangeEvent; +import org.bukkit.event.weather.ThunderChangeEvent;
+import org.bukkit.event.weather.WeatherChangeEvent; +import org.bukkit.event.weather.WeatherChangeEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class WorldDataServer implements IWorldDataServer, SaveData { public class WorldDataServer implements IWorldDataServer, SaveData {
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
@ -18,7 +18,7 @@
private final GeneratorSettings c; private final GeneratorSettings c;
private final Lifecycle d; private final Lifecycle d;
private int e; private int e;
@@ -51,6 +56,7 @@ @@ -51,6 +57,7 @@
private final Set<String> C; private final Set<String> C;
private boolean D; private boolean D;
private final CustomFunctionCallbackTimerQueue<MinecraftServer> E; private final CustomFunctionCallbackTimerQueue<MinecraftServer> E;
@ -26,7 +26,7 @@
private WorldDataServer(@Nullable DataFixer datafixer, int i, @Nullable NBTTagCompound nbttagcompound, boolean flag, int j, int k, int l, float f, long i1, long j1, int k1, int l1, int i2, boolean flag1, int j2, boolean flag2, boolean flag3, boolean flag4, WorldBorder.c worldborder_c, int k2, int l2, @Nullable UUID uuid, LinkedHashSet<String> linkedhashset, CustomFunctionCallbackTimerQueue<MinecraftServer> customfunctioncallbacktimerqueue, @Nullable NBTTagCompound nbttagcompound1, NBTTagCompound nbttagcompound2, WorldSettings worldsettings, GeneratorSettings generatorsettings, Lifecycle lifecycle) { private WorldDataServer(@Nullable DataFixer datafixer, int i, @Nullable NBTTagCompound nbttagcompound, boolean flag, int j, int k, int l, float f, long i1, long j1, int k1, int l1, int i2, boolean flag1, int j2, boolean flag2, boolean flag3, boolean flag4, WorldBorder.c worldborder_c, int k2, int l2, @Nullable UUID uuid, LinkedHashSet<String> linkedhashset, CustomFunctionCallbackTimerQueue<MinecraftServer> customfunctioncallbacktimerqueue, @Nullable NBTTagCompound nbttagcompound1, NBTTagCompound nbttagcompound2, WorldSettings worldsettings, GeneratorSettings generatorsettings, Lifecycle lifecycle) {
this.k = datafixer; this.k = datafixer;
@@ -94,7 +100,8 @@ @@ -94,7 +101,8 @@
return (NBTBase) dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap().getValue(); return (NBTBase) dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap().getValue();
}); });
@ -36,7 +36,7 @@
return SystemUtils.a(dynamic1.asString().result()); return SystemUtils.a(dynamic1.asString().result());
}).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.a, dynamic.get("ScheduledEvents").asStream()), (NBTTagCompound) dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), nbttagcompound1, worldsettings, generatorsettings, lifecycle); }).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.a, dynamic.get("ScheduledEvents").asStream()), (NBTTagCompound) dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), nbttagcompound1, worldsettings, generatorsettings, lifecycle);
} }
@@ -126,7 +133,7 @@ @@ -126,7 +134,7 @@
nbttagcompound.set("Version", nbttagcompound2); nbttagcompound.set("Version", nbttagcompound2);
nbttagcompound.setInt("DataVersion", SharedConstants.getGameVersion().getWorldVersion()); nbttagcompound.setInt("DataVersion", SharedConstants.getGameVersion().getWorldVersion());
RegistryWriteOps<NBTBase> registrywriteops = RegistryWriteOps.a(DynamicOpsNBT.a, iregistrycustom); RegistryWriteOps<NBTBase> registrywriteops = RegistryWriteOps.a(DynamicOpsNBT.a, iregistrycustom);
@ -45,7 +45,7 @@
Logger logger = WorldDataServer.LOGGER; Logger logger = WorldDataServer.LOGGER;
logger.getClass(); logger.getClass();
@@ -174,6 +181,7 @@ @@ -174,6 +182,7 @@
nbttagcompound.a("WanderingTraderId", this.B); nbttagcompound.a("WanderingTraderId", this.B);
} }
@ -53,7 +53,7 @@
} }
@Override @Override
@@ -291,6 +299,20 @@ @@ -291,6 +300,20 @@
@Override @Override
public void setThundering(boolean flag) { public void setThundering(boolean flag) {
@ -74,7 +74,7 @@
this.thundering = flag; this.thundering = flag;
} }
@@ -311,6 +333,20 @@ @@ -311,6 +334,20 @@
@Override @Override
public void setStorm(boolean flag) { public void setStorm(boolean flag) {
@ -95,7 +95,7 @@
this.raining = flag; this.raining = flag;
} }
@@ -377,6 +413,12 @@ @@ -377,6 +414,12 @@
@Override @Override
public void setDifficulty(EnumDifficulty enumdifficulty) { public void setDifficulty(EnumDifficulty enumdifficulty) {
this.b = this.b.a(enumdifficulty); this.b = this.b.a(enumdifficulty);
@ -108,7 +108,7 @@
} }
@Override @Override
@@ -481,4 +523,12 @@ @@ -481,4 +524,12 @@
public IWorldDataServer H() { public IWorldDataServer H() {
return this; return this;
} }

View File

@ -1,14 +1,15 @@
--- a/net/minecraft/server/WorldGenTreeProvider.java --- a/net/minecraft/server/WorldGenTreeProvider.java
+++ b/net/minecraft/server/WorldGenTreeProvider.java +++ b/net/minecraft/server/WorldGenTreeProvider.java
@@ -3,6 +3,7 @@ @@ -4,6 +4,8 @@
import java.util.Iterator;
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.TreeType; // CraftBukkit
+import org.bukkit.TreeType; // CraftBukkit
+
public abstract class WorldGenTreeProvider { public abstract class WorldGenTreeProvider {
@@ -17,6 +18,7 @@ public WorldGenTreeProvider() {}
@@ -17,6 +19,7 @@
if (worldgenfeatureconfigured == null) { if (worldgenfeatureconfigured == null) {
return false; return false;
} else { } else {
@ -16,7 +17,7 @@
worldserver.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 4); worldserver.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 4);
((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.f).b(); ((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.f).b();
if (worldgenfeatureconfigured.a(worldserver, chunkgenerator, random, blockposition)) { if (worldgenfeatureconfigured.a(worldserver, chunkgenerator, random, blockposition)) {
@@ -43,4 +45,46 @@ @@ -43,4 +46,46 @@
return true; return true;
} }

View File

@ -12,6 +12,7 @@ import net.minecraft.server.EntityRaider;
import net.minecraft.server.World; import net.minecraft.server.World;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Raid; import org.bukkit.Raid;
import org.bukkit.Raid.RaidStatus;
import org.bukkit.entity.Raider; import org.bukkit.entity.Raider;
public final class CraftRaid implements Raid { public final class CraftRaid implements Raid {

View File

@ -106,6 +106,7 @@ import org.bukkit.Sound;
import org.bukkit.StructureType; import org.bukkit.StructureType;
import org.bukkit.TreeType; import org.bukkit.TreeType;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.WorldBorder; import org.bukkit.WorldBorder;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.bukkit.block.Block; import org.bukkit.block.Block;

View File

@ -7,12 +7,12 @@ public class CraftBisected extends CraftBlockData implements Bisected {
private static final net.minecraft.server.BlockStateEnum<?> HALF = getEnum("half"); private static final net.minecraft.server.BlockStateEnum<?> HALF = getEnum("half");
@Override @Override
public Half getHalf() { public org.bukkit.block.data.Bisected.Half getHalf() {
return get(HALF, Half.class); return get(HALF, org.bukkit.block.data.Bisected.Half.class);
} }
@Override @Override
public void setHalf(Half half) { public void setHalf(org.bukkit.block.data.Bisected.Half half) {
set(HALF, half); set(HALF, half);
} }
} }

View File

@ -7,12 +7,12 @@ public abstract class CraftFaceAttachable extends CraftBlockData implements Face
private static final net.minecraft.server.BlockStateEnum<?> ATTACH_FACE = getEnum("face"); private static final net.minecraft.server.BlockStateEnum<?> ATTACH_FACE = getEnum("face");
@Override @Override
public AttachedFace getAttachedFace() { public org.bukkit.block.data.FaceAttachable.AttachedFace getAttachedFace() {
return get(ATTACH_FACE, AttachedFace.class); return get(ATTACH_FACE, org.bukkit.block.data.FaceAttachable.AttachedFace.class);
} }
@Override @Override
public void setAttachedFace(AttachedFace face) { public void setAttachedFace(org.bukkit.block.data.FaceAttachable.AttachedFace face) {
set(ATTACH_FACE, face); set(ATTACH_FACE, face);
} }
} }

View File

@ -7,17 +7,17 @@ public abstract class CraftRail extends CraftBlockData implements Rail {
private static final net.minecraft.server.BlockStateEnum<?> SHAPE = getEnum("shape"); private static final net.minecraft.server.BlockStateEnum<?> SHAPE = getEnum("shape");
@Override @Override
public Shape getShape() { public org.bukkit.block.data.Rail.Shape getShape() {
return get(SHAPE, Shape.class); return get(SHAPE, org.bukkit.block.data.Rail.Shape.class);
} }
@Override @Override
public void setShape(Shape shape) { public void setShape(org.bukkit.block.data.Rail.Shape shape) {
set(SHAPE, shape); set(SHAPE, shape);
} }
@Override @Override
public java.util.Set<Shape> getShapes() { public java.util.Set<org.bukkit.block.data.Rail.Shape> getShapes() {
return getValues(SHAPE, Shape.class); return getValues(SHAPE, org.bukkit.block.data.Rail.Shape.class);
} }
} }

View File

@ -8,12 +8,12 @@ public abstract class CraftBamboo extends CraftBlockData implements Bamboo {
private static final net.minecraft.server.BlockStateEnum<?> LEAVES = getEnum("leaves"); private static final net.minecraft.server.BlockStateEnum<?> LEAVES = getEnum("leaves");
@Override @Override
public Leaves getLeaves() { public org.bukkit.block.data.type.Bamboo.Leaves getLeaves() {
return get(LEAVES, Leaves.class); return get(LEAVES, org.bukkit.block.data.type.Bamboo.Leaves.class);
} }
@Override @Override
public void setLeaves(Leaves leaves) { public void setLeaves(org.bukkit.block.data.type.Bamboo.Leaves leaves) {
set(LEAVES, leaves); set(LEAVES, leaves);
} }
} }

View File

@ -9,12 +9,12 @@ public abstract class CraftBed extends CraftBlockData implements Bed {
private static final net.minecraft.server.BlockStateBoolean OCCUPIED = getBoolean("occupied"); private static final net.minecraft.server.BlockStateBoolean OCCUPIED = getBoolean("occupied");
@Override @Override
public Part getPart() { public org.bukkit.block.data.type.Bed.Part getPart() {
return get(PART, Part.class); return get(PART, org.bukkit.block.data.type.Bed.Part.class);
} }
@Override @Override
public void setPart(Part part) { public void setPart(org.bukkit.block.data.type.Bed.Part part) {
set(PART, part); set(PART, part);
} }

View File

@ -8,12 +8,12 @@ public abstract class CraftBell extends CraftBlockData implements Bell {
private static final net.minecraft.server.BlockStateEnum<?> ATTACHMENT = getEnum("attachment"); private static final net.minecraft.server.BlockStateEnum<?> ATTACHMENT = getEnum("attachment");
@Override @Override
public Attachment getAttachment() { public org.bukkit.block.data.type.Bell.Attachment getAttachment() {
return get(ATTACHMENT, Attachment.class); return get(ATTACHMENT, org.bukkit.block.data.type.Bell.Attachment.class);
} }
@Override @Override
public void setAttachment(Attachment leaves) { public void setAttachment(org.bukkit.block.data.type.Bell.Attachment leaves) {
set(ATTACHMENT, leaves); set(ATTACHMENT, leaves);
} }
} }

View File

@ -8,12 +8,12 @@ public abstract class CraftChest extends CraftBlockData implements Chest {
private static final net.minecraft.server.BlockStateEnum<?> TYPE = getEnum("type"); private static final net.minecraft.server.BlockStateEnum<?> TYPE = getEnum("type");
@Override @Override
public Type getType() { public org.bukkit.block.data.type.Chest.Type getType() {
return get(TYPE, Type.class); return get(TYPE, org.bukkit.block.data.type.Chest.Type.class);
} }
@Override @Override
public void setType(Type type) { public void setType(org.bukkit.block.data.type.Chest.Type type) {
set(TYPE, type); set(TYPE, type);
} }
} }

View File

@ -8,12 +8,12 @@ public abstract class CraftComparator extends CraftBlockData implements Comparat
private static final net.minecraft.server.BlockStateEnum<?> MODE = getEnum("mode"); private static final net.minecraft.server.BlockStateEnum<?> MODE = getEnum("mode");
@Override @Override
public Mode getMode() { public org.bukkit.block.data.type.Comparator.Mode getMode() {
return get(MODE, Mode.class); return get(MODE, org.bukkit.block.data.type.Comparator.Mode.class);
} }
@Override @Override
public void setMode(Mode mode) { public void setMode(org.bukkit.block.data.type.Comparator.Mode mode) {
set(MODE, mode); set(MODE, mode);
} }
} }

View File

@ -8,12 +8,12 @@ public abstract class CraftDoor extends CraftBlockData implements Door {
private static final net.minecraft.server.BlockStateEnum<?> HINGE = getEnum("hinge"); private static final net.minecraft.server.BlockStateEnum<?> HINGE = getEnum("hinge");
@Override @Override
public Hinge getHinge() { public org.bukkit.block.data.type.Door.Hinge getHinge() {
return get(HINGE, Hinge.class); return get(HINGE, org.bukkit.block.data.type.Door.Hinge.class);
} }
@Override @Override
public void setHinge(Hinge hinge) { public void setHinge(org.bukkit.block.data.type.Door.Hinge hinge) {
set(HINGE, hinge); set(HINGE, hinge);
} }
} }

View File

@ -8,12 +8,12 @@ public abstract class CraftJigsaw extends CraftBlockData implements Jigsaw {
private static final net.minecraft.server.BlockStateEnum<?> ORIENTATION = getEnum("orientation"); private static final net.minecraft.server.BlockStateEnum<?> ORIENTATION = getEnum("orientation");
@Override @Override
public Orientation getOrientation() { public org.bukkit.block.data.type.Jigsaw.Orientation getOrientation() {
return get(ORIENTATION, Orientation.class); return get(ORIENTATION, org.bukkit.block.data.type.Jigsaw.Orientation.class);
} }
@Override @Override
public void setOrientation(Orientation orientation) { public void setOrientation(org.bukkit.block.data.type.Jigsaw.Orientation orientation) {
set(ORIENTATION, orientation); set(ORIENTATION, orientation);
} }
} }

Some files were not shown because too many files have changed in this diff Show More