13
0
geforkt von Mirrors/Paper

Organise imports

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2021-03-09 08:47:33 +11:00
Ursprung 1ae7bcc4d0
Commit b2efd58164
188 geänderte Dateien mit 879 neuen und 825 gelöschten Zeilen

Datei anzeigen

@ -1,18 +1,19 @@
--- a/net/minecraft/server/BehaviorAttackTargetForget.java
+++ b/net/minecraft/server/BehaviorAttackTargetForget.java
@@ -3,6 +3,11 @@
import com.google.common.collect.ImmutableMap;
@@ -4,6 +4,12 @@
import java.util.Optional;
import java.util.function.Predicate;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end
+
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) {

Datei anzeigen

@ -1,18 +1,19 @@
--- a/net/minecraft/server/BehaviorAttackTargetSet.java
+++ b/net/minecraft/server/BehaviorAttackTargetSet.java
@@ -4,6 +4,11 @@
import java.util.Optional;
@@ -5,6 +5,12 @@
import java.util.function.Function;
import java.util.function.Predicate;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end
+
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) {

Datei anzeigen

@ -1,18 +1,19 @@
--- a/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 java.util.Optional;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftVillager;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.VillagerCareerChangeEvent;
+// CraftBukkit end
+
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();
entityvillager.getBehaviorController().removeMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
@ -21,7 +22,7 @@
worldserver.broadcastEntityEffect(entityvillager, (byte) 14);
if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) {
MinecraftServer minecraftserver = worldserver.getMinecraftServer();
@@ -31,7 +36,14 @@
@@ -31,7 +37,14 @@
return villagerprofession.b() == villageplacetype;
}).findFirst();
}).ifPresent((villagerprofession) -> {

Datei anzeigen

@ -1,18 +1,19 @@
--- a/net/minecraft/server/BehaviorProfession.java
+++ b/net/minecraft/server/BehaviorProfession.java
@@ -1,6 +1,11 @@
package net.minecraft.server;
@@ -2,6 +2,12 @@
import com.google.common.collect.ImmutableMap;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftVillager;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.VillagerCareerChangeEvent;
+// CraftBukkit end
+
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) {

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/BlockComposter.java
+++ b/net/minecraft/server/BlockComposter.java
@@ -4,13 +4,17 @@
import it.unimi.dsi.fastutil.objects.Object2FloatOpenHashMap;
@@ -5,12 +5,17 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftBlockInventoryHolder;
+import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
+// CraftBukkit end
+
public class BlockComposter extends Block implements IInventoryHolder {
public static final BlockStateInteger a = BlockProperties.as;
@ -19,7 +19,7 @@
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);
}
@@ -156,18 +160,25 @@
@@ -156,18 +161,25 @@
return EnumInteractionResult.a(world.isClientSide);
} else if (i == 8) {
@ -48,7 +48,7 @@
itemstack.subtract(1);
return iblockdata1;
@@ -176,7 +187,15 @@
@@ -176,7 +188,15 @@
}
}
@ -65,7 +65,7 @@
if (!world.isClientSide) {
float f = 0.7F;
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) {
@ -83,7 +83,7 @@
return iblockdata;
} else {
int j = i + 1;
@@ -253,7 +278,8 @@
@@ -253,7 +279,8 @@
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
int i = (Integer) iblockdata.get(BlockComposter.a);
@ -93,7 +93,7 @@
}
static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
@@ -265,6 +291,7 @@
@@ -265,6 +292,7 @@
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
super(1);
@ -101,7 +101,7 @@
this.a = iblockdata;
this.b = generatoraccess;
this.c = blockposition;
@@ -317,6 +344,7 @@
@@ -317,6 +345,7 @@
this.blockData = iblockdata;
this.generatorAccess = generatoraccess;
this.blockPosition = blockposition;
@ -109,7 +109,7 @@
}
@Override
@@ -341,15 +369,23 @@
@@ -341,15 +370,23 @@
@Override
public void update() {

Datei anzeigen

@ -1,20 +1,17 @@
--- a/net/minecraft/server/BlockPortal.java
+++ b/net/minecraft/server/BlockPortal.java
@@ -2,6 +2,13 @@
@@ -2,6 +2,10 @@
import java.util.Random;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.block.CraftBlockState;
+import org.bukkit.event.entity.EntityPortalEnterEvent;
+import org.bukkit.event.world.PortalCreateEvent;
+// CraftBukkit end
+
public class BlockPortal extends Block {
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)) {
@ -24,7 +21,7 @@
if (entity != null) {
entity.resetPortalCooldown();
@@ -54,6 +62,10 @@
@@ -54,6 +59,10 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.canPortal()) {

Datei anzeigen

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

Datei anzeigen

@ -1,19 +1,20 @@
--- a/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 java.util.Queue;
+// CraftBukkit start
+import java.util.List;
+import org.bukkit.craftbukkit.block.CraftBlockState;
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
+import org.bukkit.event.block.SpongeAbsorbEvent;
+// CraftBukkit end
+
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));
int i = 0;
@ -21,7 +22,7 @@
while (!queue.isEmpty()) {
Tuple<BlockPosition, Integer> tuple = (Tuple) queue.poll();
@@ -46,27 +53,31 @@
@@ -46,27 +54,31 @@
for (int l = 0; l < k; ++l) {
EnumDirection enumdirection = aenumdirection[l];
BlockPosition blockposition2 = blockposition1.shift(enumdirection);
@ -60,7 +61,7 @@
++i;
if (j < 6) {
queue.add(new Tuple<>(blockposition2, j + 1));
@@ -79,6 +90,39 @@
@@ -79,6 +91,39 @@
break;
}
}

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/BlockSweetBerryBush.java
+++ b/net/minecraft/server/BlockSweetBerryBush.java
@@ -1,6 +1,13 @@
package net.minecraft.server;
@@ -2,6 +2,14 @@
import java.util.Random;
+// CraftBukkit start
+import java.util.Collections;
+import org.bukkit.craftbukkit.block.CraftBlock;
@ -11,10 +11,11 @@
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.player.PlayerHarvestBlockEvent;
+// CraftBukkit end
+
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);
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);
if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) {
@ -33,7 +34,7 @@
}
}
@@ -59,7 +68,15 @@
@@ -59,7 +69,15 @@
} else if (i > 1) {
int j = 1 + world.random.nextInt(2);

Datei anzeigen

@ -1,14 +1,15 @@
--- a/net/minecraft/server/BlockTrapdoor.java
+++ b/net/minecraft/server/BlockTrapdoor.java
@@ -1,6 +1,7 @@
package net.minecraft.server;
@@ -2,6 +2,8 @@
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 {
@@ -88,6 +89,19 @@
public static final BlockStateBoolean OPEN = BlockProperties.u;
@@ -88,6 +90,19 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
if (flag1 != (Boolean) iblockdata.get(BlockTrapdoor.c)) {

Datei anzeigen

@ -1,18 +1,18 @@
--- a/net/minecraft/server/BlockTurtleEgg.java
+++ b/net/minecraft/server/BlockTurtleEgg.java
@@ -2,6 +2,12 @@
@@ -3,6 +3,12 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.block.CraftBlock;
+
+// CraftBukkit start
+import org.bukkit.event.entity.EntityInteractEvent;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
+
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 @@
IBlockData iblockdata = world.getType(blockposition);

Datei anzeigen

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

Datei anzeigen

@ -1,25 +1,17 @@
--- a/net/minecraft/server/CommandBlockListenerAbstract.java
+++ b/net/minecraft/server/CommandBlockListenerAbstract.java
@@ -4,6 +4,7 @@
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 @@
@@ -17,6 +17,10 @@
private IChatBaseComponent lastOutput;
private String command = "";
private IChatBaseComponent customName;
+ // CraftBukkit start
+ @Override
+ public abstract CommandSender getBukkitSender(CommandListenerWrapper wrapper);
+ public abstract org.bukkit.command.CommandSender getBukkitSender(CommandListenerWrapper wrapper);
+ // CraftBukkit end
public CommandBlockListenerAbstract() {
this.customName = CommandBlockListenerAbstract.c;
@@ -113,7 +118,7 @@
@@ -113,7 +117,7 @@
});

Datei anzeigen

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

Datei anzeigen

@ -1,18 +1,19 @@
--- a/net/minecraft/server/CommandTeleport.java
+++ b/net/minecraft/server/CommandTeleport.java
@@ -12,6 +12,11 @@
import java.util.Iterator;
@@ -13,6 +13,12 @@
import java.util.Set;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.event.entity.EntityTeleportEvent;
+// CraftBukkit end
+
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) {
@ -24,7 +25,7 @@
}
entity.setHeadRotation(f);
@@ -139,6 +144,21 @@
@@ -139,6 +145,21 @@
float f3 = MathHelper.g(f1);
f3 = MathHelper.a(f3, -90.0F, 90.0F);

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,16 +1,16 @@
--- a/net/minecraft/server/ContainerGrindstone.java
+++ b/net/minecraft/server/ContainerGrindstone.java
@@ -4,9 +4,30 @@
import java.util.Map;
@@ -5,8 +5,30 @@
import java.util.Map.Entry;
import java.util.stream.Collectors;
+// CraftBukkit start
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.inventory.CraftInventoryGrindstone;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+import org.bukkit.entity.Player;
+// CraftBukkit end
+
public class ContainerGrindstone extends Container {
+ // CraftBukkit start
@ -31,7 +31,7 @@
private final IInventory resultInventory;
private final IInventory craftInventory;
private final ContainerAccess containerAccess;
@@ -24,6 +45,13 @@
@@ -24,6 +46,13 @@
super.update();
ContainerGrindstone.this.a((IInventory) this);
}
@ -45,7 +45,7 @@
};
this.containerAccess = containeraccess;
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));
}
@ -53,7 +53,7 @@
}
@Override
@@ -235,6 +264,7 @@
@@ -235,6 +265,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,18 +1,21 @@
--- a/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.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 final boolean debug = this.getBoolean("debug", false); // CraftBukkit
public final boolean onlineMode = this.getBoolean("online-mode", true);
public final boolean preventProxyConnections = this.getBoolean("prevent-proxy-connections", false);
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 GeneratorSettings generatorSettings;
@ -25,7 +28,7 @@
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.levelName = this.getString("level-name", "world");
@@ -107,12 +111,14 @@
@@ -107,12 +115,14 @@
this.generatorSettings = GeneratorSettings.a(iregistrycustom, properties);
}

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,23 +1,6 @@
--- a/net/minecraft/server/DispenserRegistry.java
+++ b/net/minecraft/server/DispenserRegistry.java
@@ -7,6 +7,16 @@
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 @@
@@ -31,6 +31,69 @@
TagStatic.b();
d();
}

Datei anzeigen

@ -1,17 +1,18 @@
--- a/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.Logger;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftEnderDragon;
+import org.bukkit.event.entity.EnderDragonChangePhaseEvent;
+// CraftBukkit end
+
public class DragonControllerManager {
@@ -21,6 +25,19 @@
private static final Logger LOGGER = LogManager.getLogger();
@@ -21,6 +26,19 @@
this.currentDragonController.e();
}
@ -31,7 +32,7 @@
this.currentDragonController = this.b(dragoncontrollerphase);
if (!this.enderDragon.world.isClientSide) {
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, dragoncontrollerphase.b());
@@ -42,6 +59,6 @@
@@ -42,6 +60,6 @@
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
}

Datei anzeigen

@ -1,17 +1,6 @@
--- a/net/minecraft/server/EnchantmentFrostWalker.java
+++ b/net/minecraft/server/EnchantmentFrostWalker.java
@@ -1,6 +1,10 @@
package net.minecraft.server;
import java.util.Iterator;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.event.block.EntityBlockFormEvent;
+// CraftBukkit end
public class EnchantmentFrostWalker extends Enchantment {
@@ -46,8 +50,11 @@
@@ -46,8 +46,11 @@
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())) {

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,14 +1,15 @@
--- a/net/minecraft/server/EntityBat.java
+++ b/net/minecraft/server/EntityBat.java
@@ -4,6 +4,7 @@
import java.time.temporal.ChronoField;
@@ -5,6 +5,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
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) {
@ -38,7 +39,7 @@
}
} else {
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.yaw += f1;
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;
} else {
if (!this.world.isClientSide && this.isAsleep()) {

Datei anzeigen

@ -1,18 +1,19 @@
--- a/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.Iterator;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.ExplosionPrimeEvent;
+// CraftBukkit end
+
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
public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) {
super.onLightningStrike(worldserver, entitylightning);
@ -33,7 +34,7 @@
@Override
protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand 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;
float f = this.isPowered() ? 2.0F : 1.0F;
@ -56,7 +57,7 @@
}
}
@@ -206,6 +229,7 @@
@@ -206,6 +230,7 @@
if (!collection.isEmpty()) {
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX(), this.locY(), this.locZ());
@ -64,7 +65,7 @@
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
@@ -219,7 +243,7 @@
@@ -219,7 +244,7 @@
entityareaeffectcloud.addEffect(new MobEffect(mobeffect));
}

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,14 +1,15 @@
--- a/net/minecraft/server/EntityFireworks.java
+++ b/net/minecraft/server/EntityFireworks.java
@@ -4,6 +4,7 @@
import java.util.List;
@@ -5,6 +5,8 @@
import java.util.OptionalInt;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
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) {
@ -21,7 +22,7 @@
}
}
@@ -136,7 +141,11 @@
@@ -136,7 +142,11 @@
protected void a(MovingObjectPositionEntity movingobjectpositionentity) {
super.a(movingobjectpositionentity);
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);
if (!this.world.s_() && this.hasExplosions()) {
@ -47,7 +48,7 @@
}
super.a(movingobjectpositionblock);
@@ -172,7 +185,9 @@
@@ -172,7 +186,9 @@
if (f > 0.0F) {
if (this.ridingEntity != null) {
@ -57,7 +58,7 @@
}
double d0 = 5.0D;
@@ -199,7 +214,9 @@
@@ -199,7 +215,9 @@
if (flag) {
float f1 = f * (float) Math.sqrt((5.0D - (double) this.g((Entity) entityliving)) / 5.0D);

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntityMinecartContainer.java
+++ b/net/minecraft/server/EntityMinecartContainer.java
@@ -2,6 +2,13 @@
@@ -3,6 +3,14 @@
import java.util.Iterator;
import javax.annotation.Nullable;
+// CraftBukkit start
+import java.util.List;
+import org.bukkit.Location;
@ -11,10 +11,11 @@
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end
+
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 long lootTableSeed;

Datei anzeigen

@ -1,17 +1,18 @@
--- a/net/minecraft/server/EntityMushroomCow.java
+++ b/net/minecraft/server/EntityMushroomCow.java
@@ -4,6 +4,10 @@
import java.util.Random;
@@ -5,6 +5,11 @@
import java.util.UUID;
import org.apache.commons.lang3.tuple.Pair;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTransformEvent;
+// CraftBukkit end
+
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);
return EnumInteractionResult.a(this.world.isClientSide);
} else if (itemstack.getItem() == Items.SHEARS && this.canShear()) {
@ -23,7 +24,7 @@
this.shear(SoundCategory.PLAYERS);
if (!this.world.isClientSide) {
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);
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);
@ -32,7 +33,7 @@
EntityCow entitycow = (EntityCow) EntityTypes.COW.a(this.world);
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
@@ -137,7 +146,14 @@
@@ -137,7 +147,14 @@
}
entitycow.setInvulnerable(this.isInvulnerable());

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntityPotion.java
+++ b/net/minecraft/server/EntityPotion.java
@@ -4,6 +4,13 @@
import java.util.List;
@@ -5,6 +5,14 @@
import java.util.function.Predicate;
import javax.annotation.Nullable;
+// CraftBukkit start
+import java.util.HashMap;
+import java.util.Map;
@ -11,10 +11,11 @@
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.entity.LivingEntity;
+// CraftBukkit end
+
public class EntityPotion extends EntityProjectileThrowable {
@@ -69,7 +76,7 @@
public static final Predicate<EntityLiving> b = EntityLiving::dO;
@@ -69,7 +77,7 @@
if (flag) {
this.splash();
@ -23,7 +24,7 @@
if (this.isLingering()) {
this.a(itemstack, potionregistry);
} else {
@@ -106,6 +113,7 @@
@@ -106,6 +114,7 @@
private void a(List<MobEffect> list, @Nullable Entity entity) {
AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D);
List<EntityLiving> list1 = this.world.a(EntityLiving.class, axisalignedbb);
@ -31,7 +32,7 @@
if (!list1.isEmpty()) {
Iterator iterator = list1.iterator();
@@ -123,21 +131,46 @@
@@ -123,21 +132,46 @@
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);
+ if (!event.isCancelled() && list != null && !list.isEmpty()) { // do not process effects if there are no effects to process
+ for (LivingEntity victim : event.getAffectedEntities()) {
@ -86,13 +74,26 @@
+ mobeffectlist.applyInstantEffect(this, this.getShooter(), entityliving, mobeffect.getAmplifier(), d1);
+ } else {
+ 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) {
+ 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"));
}
@ -108,7 +109,7 @@
}
public boolean isLingering() {
@@ -184,11 +224,19 @@
@@ -184,11 +225,19 @@
IBlockData iblockdata = this.world.getType(blockposition);
if (iblockdata.a((Tag) TagsBlock.FIRE)) {

Datei anzeigen

@ -1,17 +1,18 @@
--- a/net/minecraft/server/EntityShulker.java
+++ b/net/minecraft/server/EntityShulker.java
@@ -6,6 +6,10 @@
import java.util.Optional;
@@ -7,6 +7,11 @@
import java.util.UUID;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.Location;
+import org.bukkit.event.entity.EntityTeleportEvent;
+// CraftBukkit end
+
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(7, new EntityShulker.e());
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
@ -20,7 +21,7 @@
this.targetSelector.a(2, new EntityShulker.d(this));
this.targetSelector.a(3, new EntityShulker.c(this));
}
@@ -279,6 +283,16 @@
@@ -279,6 +284,16 @@
EnumDirection enumdirection = this.g(blockposition1);
if (enumdirection != null) {
@ -37,7 +38,7 @@
this.datawatcher.set(EntityShulker.b, enumdirection);
this.playSound(SoundEffects.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F);
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);

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntitySlime.java
+++ b/net/minecraft/server/EntitySlime.java
@@ -5,6 +5,13 @@
import java.util.Optional;
@@ -6,6 +6,14 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import java.util.ArrayList;
+import java.util.List;
@ -11,10 +11,11 @@
+import org.bukkit.event.entity.EntityTransformEvent;
+import org.bukkit.event.entity.SlimeSplitEvent;
+// CraftBukkit end
+
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
public EntityTypes<? extends EntitySlime> getEntityType() {
@ -23,7 +24,7 @@
}
@Override
@@ -163,6 +170,19 @@
@@ -163,6 +171,19 @@
int j = i / 2;
int k = 2 + this.random.nextInt(3);
@ -43,7 +44,7 @@
for (int l = 0; l < k; ++l) {
float f1 = ((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.setSize(j, true);
entityslime.setPositionRotation(this.locX() + (double) f1, this.locY() + 0.5D, this.locZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);

Datei anzeigen

@ -1,16 +1,17 @@
--- a/net/minecraft/server/EntitySnowman.java
+++ b/net/minecraft/server/EntitySnowman.java
@@ -1,6 +1,9 @@
package net.minecraft.server;
@@ -2,6 +2,10 @@
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
+
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());
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)) {
@@ -76,7 +79,7 @@
@@ -76,7 +80,7 @@
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)) {
@ -28,7 +29,7 @@
}
}
}
@@ -107,6 +110,11 @@
@@ -107,6 +111,11 @@
ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.getItem() == Items.SHEARS && this.canShear()) {

Datei anzeigen

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

Datei anzeigen

@ -1,14 +1,6 @@
--- a/net/minecraft/server/EntityVex.java
+++ b/net/minecraft/server/EntityVex.java
@@ -2,6 +2,7 @@
import java.util.EnumSet;
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityTargetEvent;
public class EntityVex extends EntityMonster {
@@ -45,7 +46,7 @@
@@ -45,7 +45,7 @@
this.goalSelector.a(8, new EntityVex.d());
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.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(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
}
@@ -186,7 +187,7 @@
@@ -186,7 +186,7 @@
@Override
public void c() {
- 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();
}
}

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,11 +1,10 @@
--- a/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 javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.entity.Zombie;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
@ -16,7 +15,7 @@
public class EntityZombie extends EntityMonster {
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
@@ -23,6 +32,7 @@
@@ -23,6 +31,7 @@
private boolean bs;
private int bt;
public int drownedConversionTime;
@ -24,7 +23,7 @@
public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) {
super(entitytypes, world);
@@ -139,7 +149,10 @@
@@ -139,7 +148,10 @@
public void tick() {
if (!this.world.isClientSide && this.isAlive() && !this.isNoAI()) {
if (this.isDrownConverting()) {
@ -36,7 +35,7 @@
if (this.drownedConversionTime < 0) {
this.eP();
}
@@ -156,6 +169,7 @@
@@ -156,6 +168,7 @@
}
super.tick();
@ -44,7 +43,7 @@
}
@Override
@@ -188,6 +202,7 @@
@@ -188,6 +201,7 @@
}
public void startDrownedConversion(int i) {
@ -52,7 +51,7 @@
this.drownedConversionTime = i;
this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true);
}
@@ -201,11 +216,15 @@
@@ -201,11 +215,15 @@
}
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)) {
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())) {
@ -81,7 +80,7 @@
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));
break;
@@ -268,7 +287,14 @@
@@ -268,7 +286,14 @@
float f = this.world.getDamageScaler(this.getChunkCoordinates()).b();
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;
@ -111,7 +110,7 @@
entityzombievillager.prepare(worldserver, worldserver.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), (NBTTagCompound) null);
entityzombievillager.setVillagerData(entityvillager.getVillagerData());
@@ -406,7 +437,7 @@
@@ -406,7 +436,7 @@
entitychicken1.prepare(worldaccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null);
entitychicken1.setChickenJockey(true);
this.startRiding(entitychicken1);

Datei anzeigen

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

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/FluidTypeFlowing.java
+++ b/net/minecraft/server/FluidTypeFlowing.java
@@ -10,6 +10,14 @@
import java.util.Iterator;
@@ -11,6 +11,15 @@
import java.util.Map;
import java.util.Map.Entry;
+// CraftBukkit start
+import org.bukkit.block.BlockFace;
+import org.bukkit.craftbukkit.block.CraftBlock;
@ -12,10 +12,11 @@
+import org.bukkit.event.block.BlockFromToEvent;
+import org.bukkit.event.block.FluidLevelChangeEvent;
+// CraftBukkit end
+
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);
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);
if (this.a((IWorldReader) generatoraccess, blockposition) >= 3) {
this.a(generatoraccess, blockposition, fluid, iblockdata);
@@ -140,6 +157,15 @@
@@ -140,6 +158,15 @@
IBlockData iblockdata1 = generatoraccess.getType(blockposition1);
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);
}
}
@@ -418,12 +444,23 @@
@@ -418,12 +445,23 @@
if (fluid1.isEmpty()) {
fluid = fluid1;

Datei anzeigen

@ -1,15 +1,12 @@
--- a/net/minecraft/server/FurnaceRecipe.java
+++ b/net/minecraft/server/FurnaceRecipe.java
@@ -1,5 +1,16 @@
@@ -1,5 +1,13 @@
package net.minecraft.server;
+// CraftBukkit start
+import java.util.ArrayList;
+import java.util.List;
+import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.inventory.Recipe;
+// CraftBukkit end
@ -17,7 +14,7 @@
public class FurnaceRecipe extends RecipeCooking {
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() {
return RecipeSerializer.p;
}

Datei anzeigen

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

Datei anzeigen

@ -1,21 +1,21 @@
--- a/net/minecraft/server/IDispenseBehavior.java
+++ b/net/minecraft/server/IDispenseBehavior.java
@@ -3,6 +3,15 @@
import java.util.Iterator;
@@ -4,6 +4,15 @@
import java.util.List;
import java.util.Random;
+// CraftBukkit start
+import org.bukkit.Location;
+import org.bukkit.TreeType;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+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 interface IDispenseBehavior {
IDispenseBehavior NONE = (isourceblock, itemstack) -> {
@@ -44,7 +53,7 @@
BlockDispenser.a((IMaterial) Items.EGG, (IDispenseBehavior) (new DispenseBehaviorProjectile() {
@Override

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,19 +1,20 @@
--- a/net/minecraft/server/LootTable.java
+++ b/net/minecraft/server/LootTable.java
@@ -18,6 +18,12 @@
import org.apache.commons.lang3.ArrayUtils;
@@ -19,6 +19,13 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.stream.Collectors;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.world.LootGenerateEvent;
+// CraftBukkit end
+
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) {

Datei anzeigen

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

Datei anzeigen

@ -1,18 +1,19 @@
--- a/net/minecraft/server/PathfinderGoalFollowOwner.java
+++ b/net/minecraft/server/PathfinderGoalFollowOwner.java
@@ -1,6 +1,11 @@
package net.minecraft.server;
@@ -2,6 +2,12 @@
import java.util.EnumSet;
+// CraftBukkit start
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftEntity;
+import org.bukkit.event.entity.EntityTeleportEvent;
+// CraftBukkit end
+
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))) {
return false;
} else {

Datei anzeigen

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

Datei anzeigen

@ -1,14 +1,15 @@
--- a/net/minecraft/server/PathfinderGoalTarget.java
+++ b/net/minecraft/server/PathfinderGoalTarget.java
@@ -1,6 +1,7 @@
package net.minecraft.server;
@@ -2,6 +2,8 @@
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
+
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) {
return false;
} else {
@ -17,7 +18,7 @@
return true;
}
}
@@ -80,7 +81,7 @@
@@ -80,7 +82,7 @@
@Override
public void d() {

Datei anzeigen

@ -1,19 +1,20 @@
--- a/net/minecraft/server/PathfinderGoalTempt.java
+++ b/net/minecraft/server/PathfinderGoalTempt.java
@@ -1,6 +1,12 @@
package net.minecraft.server;
@@ -2,6 +2,13 @@
import java.util.EnumSet;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetEvent;
+import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
+// CraftBukkit end
+
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 h;
private double i;
@ -22,7 +23,7 @@
private int j;
private boolean k;
private final RecipeItemStack l;
@@ -40,7 +46,17 @@
@@ -40,7 +47,17 @@
return false;
} else {
this.target = this.a.world.a(PathfinderGoalTempt.c, (EntityLiving) this.a);

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,9 +1,9 @@
--- a/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.JsonObject;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
@ -11,10 +11,11 @@
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.inventory.Recipe;
+// CraftBukkit end
+
public class RecipeSmithing implements IRecipe<IInventory> {
@@ -58,6 +65,17 @@
private final RecipeItemStack a;
@@ -58,6 +66,17 @@
return Recipes.SMITHING;
}

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,20 +1,18 @@
--- a/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 javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.potion.CraftPotionUtil;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.potion.PotionEffect;
+// CraftBukkit end
+
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}};
@@ -24,6 +31,15 @@
@@ -24,6 +29,15 @@
public IChatBaseComponent customName;
public ChestLock chestLock;
private final IContainerProperties containerProperties;
@ -30,7 +28,7 @@
public TileEntityBeacon() {
super(TileEntityTypes.BEACON);
@@ -192,39 +208,78 @@
@@ -192,39 +206,78 @@
super.al_();
}
@ -119,7 +117,7 @@
public void a(SoundEffect soundeffect) {
this.world.playSound((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
@@ -254,8 +309,11 @@
@@ -254,8 +307,11 @@
@Override
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
super.load(iblockdata, nbttagcompound);

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,17 +1,18 @@
--- a/net/minecraft/server/TileEntityConduit.java
+++ b/net/minecraft/server/TileEntityConduit.java
@@ -6,6 +6,10 @@
import java.util.Random;
@@ -7,6 +7,11 @@
import java.util.UUID;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
+
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();
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.k = null;
} else if (this.target == null) {
@ -29,7 +30,7 @@
return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain();
});
@@ -187,8 +191,13 @@
@@ -187,8 +192,13 @@
}
if (this.target != null) {
@ -45,7 +46,7 @@
}
if (entityliving != this.target) {
@@ -221,7 +230,7 @@
@@ -221,7 +231,7 @@
@Nullable
private EntityLiving x() {

Datei anzeigen

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

Datei anzeigen

@ -1,19 +1,20 @@
--- a/net/minecraft/server/TileEntityEndGateway.java
+++ b/net/minecraft/server/TileEntityEndGateway.java
@@ -6,6 +6,12 @@
import javax.annotation.Nullable;
@@ -7,6 +7,13 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.bukkit.event.player.PlayerTeleportEvent;
+// CraftBukkit end
+
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) {
if (this.world instanceof WorldServer && !this.f()) {
this.c = 100;
@ -22,7 +23,7 @@
this.a((WorldServer) this.world);
}
@@ -142,6 +148,27 @@
@@ -142,6 +149,27 @@
entity1 = entity.getRootVehicle();
}
@ -50,7 +51,7 @@
entity1.resetPortalCooldown();
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) {

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/TileEntityFurnace.java
+++ b/net/minecraft/server/TileEntityFurnace.java
@@ -9,6 +9,16 @@
import java.util.List;
@@ -10,6 +10,17 @@
import java.util.Map;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
@ -14,10 +14,11 @@
+import org.bukkit.event.inventory.FurnaceExtractEvent;
+import org.bukkit.event.inventory.FurnaceSmeltEvent;
+// CraftBukkit end
+
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;
}
@ -54,7 +55,7 @@
private static boolean b(Item 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);
}
} else {
@ -81,7 +82,7 @@
flag1 = true;
if (!itemstack.isEmpty()) {
Item item = itemstack.getItem();
@@ -290,11 +341,38 @@
@@ -290,11 +342,38 @@
ItemStack itemstack1 = irecipe.getResult();
ItemStack itemstack2 = (ItemStack) this.items.get(2);
@ -120,7 +121,7 @@
if (!this.world.isClientSide) {
this.a(irecipe);
@@ -319,7 +397,7 @@
@@ -319,7 +398,7 @@
}
protected int getRecipeCookingTime() {
@ -129,7 +130,7 @@
}
public static boolean isFuel(ItemStack itemstack) {
@@ -446,14 +524,20 @@
@@ -446,14 +525,20 @@
@Override
public void b(EntityHuman entityhuman) {}
@ -152,7 +153,7 @@
List<IRecipe<?>> list = Lists.newArrayList();
ObjectIterator objectiterator = this.n.object2IntEntrySet().iterator();
@@ -462,14 +546,14 @@
@@ -462,14 +547,14 @@
world.getCraftingManager().getRecipe((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
list.add(irecipe);
@ -169,7 +170,7 @@
int j = MathHelper.d((float) i * f);
float f1 = MathHelper.h((float) i * f);
@@ -477,6 +561,14 @@
@@ -477,6 +562,14 @@
++j;
}

Datei anzeigen

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

Datei anzeigen

@ -1,17 +1,18 @@
--- a/net/minecraft/server/TileEntityShulkerBox.java
+++ b/net/minecraft/server/TileEntityShulkerBox.java
@@ -3,6 +3,10 @@
import java.util.List;
@@ -4,6 +4,11 @@
import java.util.stream.IntStream;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
+// CraftBukkit end
+
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 boolean m;
@ -49,7 +50,7 @@
public TileEntityShulkerBox(@Nullable EnumColor enumcolor) {
super(TileEntityTypes.SHULKER_BOX);
this.contents = NonNullList.a(27, ItemStack.b);
@@ -178,6 +213,7 @@
@@ -178,6 +214,7 @@
}
++this.viewingCount;
@ -57,7 +58,7 @@
this.world.playBlockAction(this.position, this.getBlock().getBlock(), 1, this.viewingCount);
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);
@@ -190,6 +226,7 @@
@@ -190,6 +227,7 @@
public void closeContainer(EntityHuman entityhuman) {
if (!entityhuman.isSpectator()) {
--this.viewingCount;

Datei anzeigen

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

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/WorldDataServer.java
+++ b/net/minecraft/server/WorldDataServer.java
@@ -13,11 +13,16 @@
import javax.annotation.Nullable;
@@ -14,10 +14,16 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import org.bukkit.Bukkit;
+import org.bukkit.event.weather.ThunderChangeEvent;
+import org.bukkit.event.weather.WeatherChangeEvent;
+// CraftBukkit end
+
public class WorldDataServer implements IWorldDataServer, SaveData {
private static final Logger LOGGER = LogManager.getLogger();
@ -18,7 +18,7 @@
private final GeneratorSettings c;
private final Lifecycle d;
private int e;
@@ -51,6 +56,7 @@
@@ -51,6 +57,7 @@
private final Set<String> C;
private boolean D;
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) {
this.k = datafixer;
@@ -94,7 +100,8 @@
@@ -94,7 +101,8 @@
return (NBTBase) dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap().getValue();
});
@ -36,7 +36,7 @@
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);
}
@@ -126,7 +133,7 @@
@@ -126,7 +134,7 @@
nbttagcompound.set("Version", nbttagcompound2);
nbttagcompound.setInt("DataVersion", SharedConstants.getGameVersion().getWorldVersion());
RegistryWriteOps<NBTBase> registrywriteops = RegistryWriteOps.a(DynamicOpsNBT.a, iregistrycustom);
@ -45,7 +45,7 @@
Logger logger = WorldDataServer.LOGGER;
logger.getClass();
@@ -174,6 +181,7 @@
@@ -174,6 +182,7 @@
nbttagcompound.a("WanderingTraderId", this.B);
}
@ -53,7 +53,7 @@
}
@Override
@@ -291,6 +299,20 @@
@@ -291,6 +300,20 @@
@Override
public void setThundering(boolean flag) {
@ -74,7 +74,7 @@
this.thundering = flag;
}
@@ -311,6 +333,20 @@
@@ -311,6 +334,20 @@
@Override
public void setStorm(boolean flag) {
@ -95,7 +95,7 @@
this.raining = flag;
}
@@ -377,6 +413,12 @@
@@ -377,6 +414,12 @@
@Override
public void setDifficulty(EnumDifficulty enumdifficulty) {
this.b = this.b.a(enumdifficulty);
@ -108,7 +108,7 @@
}
@Override
@@ -481,4 +523,12 @@
@@ -481,4 +524,12 @@
public IWorldDataServer H() {
return this;
}

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

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