Archiviert
13
0

Update to Minecraft 1.15.2

Dieser Commit ist enthalten in:
md_5 2020-01-22 08:00:00 +11:00
Ursprung 5c6b0dc6e4
Commit 6881a10803
50 geänderte Dateien mit 293 neuen und 421 gelöschten Zeilen

Datei anzeigen

@ -1,13 +1,13 @@
--- a/net/minecraft/server/Advancement.java
+++ b/net/minecraft/server/Advancement.java
@@ -27,6 +27,7 @@
private final String[][] f;
private final Set<Advancement> g = Sets.newLinkedHashSet();
private final IChatBaseComponent h;
private final String[][] requirements;
private final Set<Advancement> children = Sets.newLinkedHashSet();
private final IChatBaseComponent chatComponent;
+ public final org.bukkit.advancement.Advancement bukkit = new org.bukkit.craftbukkit.advancement.CraftAdvancement(this); // CraftBukkit
public Advancement(MinecraftKey minecraftkey, @Nullable Advancement advancement, @Nullable AdvancementDisplay advancementdisplay, AdvancementRewards advancementrewards, Map<String, Criterion> map, String[][] astring) {
this.d = minecraftkey;
this.key = minecraftkey;
@@ -210,7 +211,7 @@
}

Datei anzeigen

@ -120,14 +120,14 @@
@@ -125,13 +157,18 @@
if (i > 0 && item instanceof ItemBanner) {
if (TileEntityBanner.a(itemstack) > 0 && !world.isClientSide) {
if (TileEntityBanner.b(itemstack) > 0 && !world.isClientSide) {
+ // CraftBukkit start
+ if (!this.changeLevel(world, blockposition, iblockdata, i - 1, entityhuman, CauldronLevelChangeEvent.ChangeReason.BANNER_WASH)) {
+ return EnumInteractionResult.SUCCESS;
+ }
itemstack1 = itemstack.cloneItemStack();
itemstack1.setCount(1);
TileEntityBanner.b(itemstack1);
TileEntityBanner.c(itemstack1);
entityhuman.a(StatisticList.CLEAN_BANNER);
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack.subtract(1);

Datei anzeigen

@ -35,9 +35,9 @@
this.b = generatoraccess;
this.c = blockposition;
@@ -282,6 +285,7 @@
this.a = iblockdata;
this.b = generatoraccess;
this.c = blockposition;
this.blockData = iblockdata;
this.generatorAccess = generatoraccess;
this.blockPosition = blockposition;
+ this.bukkitOwner = new CraftBlockInventoryHolder(generatoraccess, blockposition, this); // CraftBukkit
}
@ -46,15 +46,15 @@
@Override
public void update() {
- BlockComposter.d(this.a, this.b, this.c);
- this.d = true;
- BlockComposter.d(this.blockData, this.generatorAccess, this.blockPosition);
- this.emptied = true;
+ // CraftBukkit start - allow putting items back (eg cancelled InventoryMoveItemEvent)
+ if (this.isNotEmpty()) {
+ BlockComposter.d(this.a, this.b, this.c);
+ this.d = true;
+ if (this.isEmpty()) {
+ BlockComposter.d(this.blockData, this.generatorAccess, this.blockPosition);
+ this.emptied = true;
+ } else {
+ this.b.setTypeAndData(this.c, this.a, 3);
+ this.d = false;
+ this.generatorAccess.setTypeAndData(this.blockPosition, this.blockData, 3);
+ this.emptied = false;
+ }
+ // CraftBukkit end
}

Datei anzeigen

@ -14,19 +14,19 @@
@@ -12,7 +17,7 @@
@Override
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {
if (canHarden(iblockdata1)) {
if (canHarden(world, blockposition, iblockdata1)) {
- world.setTypeAndData(blockposition, this.a, 3);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, this.a, 3); // CraftBukkit
}
}
@@ -22,7 +27,24 @@
World world = blockactioncontext.getWorld();
@@ -23,7 +28,24 @@
BlockPosition blockposition = blockactioncontext.getClickPosition();
IBlockData iblockdata = world.getType(blockposition);
- return !canHarden(world.getType(blockposition)) && !a((IBlockAccess) world, blockposition) ? super.getPlacedState(blockactioncontext) : this.a;
- return canHarden(world, blockposition, iblockdata) ? this.a : super.getPlacedState(blockactioncontext);
+ // CraftBukkit start
+ if (!canHarden(world.getType(blockposition)) && !a((IBlockAccess) world, blockposition)) {
+ if (!canHarden(world, blockposition, iblockdata)) {
+ return super.getPlacedState(blockactioncontext);
+ }
+
@ -45,8 +45,8 @@
+ // CraftBukkit end
}
private static boolean a(IBlockAccess iblockaccess, BlockPosition blockposition) {
@@ -54,6 +76,20 @@
private static boolean canHarden(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata) {
@@ -59,6 +81,20 @@
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkProviderServer.java
+++ b/net/minecraft/server/ChunkProviderServer.java
@@ -92,7 +92,7 @@
@@ -95,7 +95,7 @@
for (int l = 0; l < 4; ++l) {
if (k == this.cachePos[l] && chunkstatus == this.cacheStatus[l]) {
ichunkaccess = this.cacheChunk[l];
@ -9,7 +9,7 @@
return ichunkaccess;
}
}
@@ -136,12 +136,12 @@
@@ -141,12 +141,12 @@
if (playerchunk == null) {
return null;
} else {
@ -24,7 +24,7 @@
if (ichunkaccess1 != null) {
this.a(k, ichunkaccess1, ChunkStatus.FULL);
@@ -168,7 +168,15 @@
@@ -173,7 +173,15 @@
int l = 33 + ChunkStatus.a(chunkstatus);
PlayerChunk playerchunk = this.getChunk(k);
@ -41,7 +41,7 @@
this.chunkMapDistance.a(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
if (this.a(playerchunk, l)) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@@ -187,7 +195,7 @@
@@ -192,7 +200,7 @@
}
private boolean a(@Nullable PlayerChunk playerchunk, int i) {
@ -50,7 +50,7 @@
}
public boolean isLoaded(int i, int j) {
@@ -289,11 +297,31 @@
@@ -294,11 +302,31 @@
@Override
public void close() throws IOException {
@ -83,7 +83,7 @@
public void tick(BooleanSupplier booleansupplier) {
this.world.getMethodProfiler().enter("purge");
this.chunkMapDistance.purgeTickets();
@@ -313,13 +341,13 @@
@@ -318,13 +346,13 @@
this.lastTickTime = i;
WorldData worlddata = this.world.getWorldData();
boolean flag = worlddata.getType() == WorldType.DEBUG_ALL_BLOCK_STATES;
@ -99,7 +99,7 @@
this.world.getMethodProfiler().enter("naturalSpawnCount");
int l = this.chunkMapDistance.b();
@@ -348,8 +376,30 @@
@@ -353,8 +381,30 @@
for (int j1 = 0; j1 < i1; ++j1) {
EnumCreatureType enumcreaturetype = aenumcreaturetype1[j1];
@ -131,7 +131,7 @@
if (object2intmap.getInt(enumcreaturetype) <= k1) {
SpawnerCreature.a(enumcreaturetype, this.world, chunk, blockposition);
@@ -496,12 +546,18 @@
@@ -507,12 +557,18 @@
@Override
protected boolean executeNext() {

Datei anzeigen

@ -84,109 +84,16 @@
StringReader stringreader = new StringReader(s);
if (stringreader.canRead() && stringreader.peek() == '/') {
@@ -119,7 +173,6 @@
byte b0;
try {
- byte b1;
ChatComponentText chatcomponenttext;
try {
@@ -128,58 +181,62 @@
return i;
} catch (CommandException commandexception) {
commandlistenerwrapper.sendFailureMessage(commandexception.a());
- b1 = 0;
- return b1;
+ b0 = 0;
+ return b0;
} catch (CommandSyntaxException commandsyntaxexception) {
commandlistenerwrapper.sendFailureMessage(ChatComponentUtils.a(commandsyntaxexception.getRawMessage()));
@@ -134,7 +188,7 @@
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
- IChatBaseComponent ichatbasecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).a((chatmodifier) -> {
IChatBaseComponent ichatbasecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).a((chatmodifier) -> {
- chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, s));
- });
+ chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, label)); // CraftBukkit
});
+ chatcomponenttext = new ChatComponentText("");
if (j > 10) {
- ichatbasecomponent.a("...");
+ chatcomponenttext.a("...");
}
- ichatbasecomponent.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j));
+ chatcomponenttext.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j));
if (j < commandsyntaxexception.getInput().length()) {
- IChatBaseComponent ichatbasecomponent1 = (new ChatComponentText(commandsyntaxexception.getInput().substring(j))).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.UNDERLINE});
+ ChatComponentText chatcomponenttext1 = new ChatComponentText(commandsyntaxexception.getInput().substring(j));
- ichatbasecomponent.addSibling(ichatbasecomponent1);
+ chatcomponenttext1.getChatModifier().setColor(EnumChatFormat.RED);
+ chatcomponenttext1.getChatModifier().setUnderline(Boolean.valueOf(true));
+ chatcomponenttext.addSibling(chatcomponenttext1);
}
- ichatbasecomponent.addSibling((new ChatMessage("command.context.here", new Object[0])).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.ITALIC}));
- commandlistenerwrapper.sendFailureMessage(ichatbasecomponent);
+ ChatMessage chatmessage = new ChatMessage("command.context.here", new Object[0]);
+
+ chatmessage.getChatModifier().setItalic(Boolean.valueOf(true));
+ chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
+ chatcomponenttext.addSibling(chatmessage);
+ chatcomponenttext.getChatModifier().setColor(EnumChatFormat.GRAY);
+ chatcomponenttext.getChatModifier().setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, label)); // CraftBukkit
+ commandlistenerwrapper.sendFailureMessage(chatcomponenttext);
}
- b1 = 0;
- return b1;
+ b0 = 0;
} catch (Exception exception) {
- chatcomponenttext = new ChatComponentText;
- }
+ ChatMessage chatmessage1 = new ChatMessage("command.failed", new Object[0]);
- chatcomponenttext.<init>(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
- ChatComponentText chatcomponenttext1 = chatcomponenttext;
+ chatcomponenttext = new ChatComponentText(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
+ if (CommandDispatcher.LOGGER.isDebugEnabled()) {
+ CommandDispatcher.LOGGER.error("Command exception: {}", s, exception);
+ StackTraceElement[] astacktraceelement = exception.getStackTrace();
- if (CommandDispatcher.LOGGER.isDebugEnabled()) {
- CommandDispatcher.LOGGER.error("Command exception: {}", s, exception);
- StackTraceElement[] astacktraceelement = exception.getStackTrace();
+ for (int k = 0; k < Math.min(astacktraceelement.length, 3); ++k) {
+ chatcomponenttext.a("\n\n" + astacktraceelement[k].getMethodName() + "\n " + astacktraceelement[k].getFileName() + ":" + astacktraceelement[k].getLineNumber());
+ }
+ }
- for(int k = 0; k < Math.min(astacktraceelement.length, 3); ++k) {
- chatcomponenttext1.a("\n\n").a(astacktraceelement[k].getMethodName()).a("\n ").a(astacktraceelement[k].getFileName()).a(":").a(String.valueOf(astacktraceelement[k].getLineNumber()));
+ chatmessage1.getChatModifier().setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatcomponenttext));
+ commandlistenerwrapper.sendFailureMessage(chatmessage1);
+ if (SharedConstants.b) {
+ commandlistenerwrapper.sendFailureMessage(new ChatComponentText(SystemUtils.d(exception)));
+ CommandDispatcher.LOGGER.error("'" + s + "' threw an exception", exception);
}
- }
- commandlistenerwrapper.sendFailureMessage((new ChatMessage("command.failed", new Object[0])).a((chatmodifier) -> {
- chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatcomponenttext1));
- }));
- if (SharedConstants.b) {
- commandlistenerwrapper.sendFailureMessage(new ChatComponentText(SystemUtils.d(exception)));
- CommandDispatcher.LOGGER.error("'" + s + "' threw an exception", exception);
- }
+ byte b1 = 0;
- b0 = 0;
+ return b1;
+ }
} finally {
commandlistenerwrapper.getServer().getMethodProfiler().exit();
}
@@ -188,11 +245,36 @@
@@ -184,11 +238,36 @@
}
public void a(EntityPlayer entityplayer) {
@ -224,7 +131,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode));
}
@@ -203,7 +285,7 @@
@@ -199,7 +278,7 @@
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
if (commandnode2.canUse(commandlistenerwrapper)) {
@ -233,7 +140,7 @@
argumentbuilder.requires((icompletionprovider) -> {
return true;
@@ -226,7 +308,7 @@
@@ -222,7 +301,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
}

Datei anzeigen

@ -4,8 +4,8 @@
}
try {
- ParseResults<CommandListenerWrapper> parseresults = customfunctiondata.a().getCommandDispatcher().a().parse(stringreader, customfunctiondata.g());
+ ParseResults<CommandListenerWrapper> parseresults = customfunctiondata.d().parse(stringreader, customfunctiondata.g()); // CraftBukkit
- ParseResults<CommandListenerWrapper> parseresults = customfunctiondata.getServer().getCommandDispatcher().a().parse(stringreader, customfunctiondata.g());
+ ParseResults<CommandListenerWrapper> parseresults = customfunctiondata.getCommandDispatcher().parse(stringreader, customfunctiondata.g()); // CraftBukkit
if (parseresults.getReader().canRead()) {
throw CommandDispatcher.a(parseresults);

Datei anzeigen

@ -3,7 +3,7 @@
@@ -54,7 +54,7 @@
}
public com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> d() {
public com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> getCommandDispatcher() {
- return this.server.getCommandDispatcher().a();
+ return this.server.vanillaCommandDispatcher.a(); // CraftBukkit
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/DedicatedServer.java
+++ b/net/minecraft/server/DedicatedServer.java
@@ -25,6 +25,17 @@
@@ -26,6 +26,17 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -18,7 +18,7 @@
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
private static final Logger LOGGER = LogManager.getLogger();
@@ -38,8 +49,10 @@
@@ -39,8 +50,10 @@
@Nullable
private ServerGUI p;
@ -31,7 +31,7 @@
this.propertyManager = dedicatedserversettings;
this.remoteControlCommandListener = new RemoteControlCommandListener(this);
Thread thread = new Thread("Server Infinisleeper") {
@@ -65,13 +78,37 @@
@@ -66,13 +79,37 @@
public boolean init() throws IOException {
Thread thread = new Thread("Server console handler") {
public void run() {
@ -72,7 +72,7 @@
}
} catch (IOException ioexception) {
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
@@ -80,6 +117,27 @@
@@ -81,6 +118,27 @@
}
};
@ -100,7 +100,7 @@
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
thread.start();
@@ -133,6 +191,12 @@
@@ -134,6 +192,12 @@
return false;
}
@ -113,7 +113,7 @@
if (!this.getOnlineMode()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
@@ -147,7 +211,7 @@
@@ -148,7 +212,7 @@
if (!NameReferencingFileConverter.e(this)) {
return false;
} else {
@ -122,7 +122,7 @@
long i = SystemUtils.getMonotonicNanos();
String s = dedicatedserverproperties.levelSeed;
String s1 = dedicatedserverproperties.generatorSettings;
@@ -177,7 +241,13 @@
@@ -178,7 +242,13 @@
if (worldtype == WorldType.FLAT) {
jsonobject.addProperty("flat_world_options", s1);
} else if (!s1.isEmpty()) {
@ -137,7 +137,7 @@
}
this.a(this.getWorld(), this.getWorld(), j, worldtype, jsonobject);
@@ -199,6 +269,7 @@
@@ -200,6 +270,7 @@
DedicatedServer.LOGGER.info("Starting remote control listener");
this.remoteControlListener = new RemoteControlListener(this);
this.remoteControlListener.a();
@ -145,7 +145,7 @@
}
if (this.getMaxTickTime() > 0L) {
@@ -301,6 +372,7 @@
@@ -307,6 +378,7 @@
this.remoteStatusListener.b();
}
@ -153,7 +153,7 @@
}
@Override
@@ -334,7 +406,15 @@
@@ -340,7 +412,15 @@
while (!this.serverCommandQueue.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
@ -170,7 +170,7 @@
}
}
@@ -534,14 +614,45 @@
@@ -540,14 +620,45 @@
@Override
public String getPlugins() {
@ -218,7 +218,7 @@
});
return this.remoteControlCommandListener.getMessages();
}
@@ -562,4 +673,16 @@
@@ -568,4 +679,16 @@
public boolean a(GameProfile gameprofile) {
return false;
}

Datei anzeigen

@ -28,9 +28,9 @@
+ // CraftBukkit end
+
@Override
public boolean bt() {
return !this.isMarker() && super.bt();
@@ -386,6 +402,21 @@
public void updateSize() {
double d0 = this.locX();
@@ -381,6 +397,21 @@
return false;
} else {
ItemStack itemstack2;
@ -52,7 +52,7 @@
if (entityhuman.abilities.canInstantlyBuild && itemstack1.isEmpty() && !itemstack.isEmpty()) {
itemstack2 = itemstack.cloneItemStack();
@@ -414,12 +445,22 @@
@@ -409,12 +440,22 @@
public boolean damageEntity(DamageSource damagesource, float f) {
if (!this.world.isClientSide && !this.dead) {
if (DamageSource.OUT_OF_WORLD.equals(damagesource)) {
@ -78,7 +78,7 @@
return false;
} else if (DamageSource.FIRE.equals(damagesource)) {
if (this.isBurning()) {
@@ -444,7 +485,7 @@
@@ -439,7 +480,7 @@
} else if (damagesource.v()) {
this.F();
this.D();
@ -87,7 +87,7 @@
return flag1;
} else {
long i = this.world.getTime();
@@ -455,7 +496,7 @@
@@ -450,7 +491,7 @@
} else {
this.f(damagesource);
this.D();
@ -96,7 +96,7 @@
}
return true;
@@ -482,7 +523,7 @@
@@ -477,7 +518,7 @@
f1 -= f;
if (f1 <= 0.5F) {
this.g(damagesource);
@ -105,7 +105,7 @@
} else {
this.setHealth(f1);
}
@@ -490,13 +531,13 @@
@@ -485,13 +526,13 @@
}
private void f(DamageSource damagesource) {
@ -121,7 +121,7 @@
ItemStack itemstack;
int i;
@@ -504,7 +545,7 @@
@@ -499,7 +540,7 @@
for (i = 0; i < this.handItems.size(); ++i) {
itemstack = (ItemStack) this.handItems.get(i);
if (!itemstack.isEmpty()) {
@ -130,7 +130,7 @@
this.handItems.set(i, ItemStack.a);
}
}
@@ -512,10 +553,11 @@
@@ -507,10 +548,11 @@
for (i = 0; i < this.armorItems.size(); ++i) {
itemstack = (ItemStack) this.armorItems.get(i);
if (!itemstack.isEmpty()) {
@ -143,7 +143,7 @@
}
@@ -616,8 +658,16 @@
@@ -611,8 +653,16 @@
return this.isSmall();
}

Datei anzeigen

@ -18,7 +18,7 @@
this.world.a(blockposition, false);
} else if (!this.world.isClientSide) {
this.die();
@@ -121,6 +123,11 @@
@@ -122,6 +124,11 @@
this.block = (IBlockData) this.block.set(BlockProperties.C, true);
}
@ -30,7 +30,7 @@
if (this.world.setTypeAndData(blockposition, this.block, 3)) {
if (block instanceof BlockFalling) {
((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata);
@@ -177,7 +184,9 @@
@@ -178,7 +185,9 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();

Datei anzeigen

@ -1,24 +1,13 @@
--- a/net/minecraft/server/EntityFox.java
+++ b/net/minecraft/server/EntityFox.java
@@ -17,8 +17,8 @@
private static final DataWatcherObject<Integer> bw = DataWatcher.a(EntityFox.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Byte> bx = DataWatcher.a(EntityFox.class, DataWatcherRegistry.a);
- private static final DataWatcherObject<Optional<UUID>> by = DataWatcher.a(EntityFox.class, DataWatcherRegistry.o);
- private static final DataWatcherObject<Optional<UUID>> bz = DataWatcher.a(EntityFox.class, DataWatcherRegistry.o);
+ public static final DataWatcherObject<Optional<UUID>> by = DataWatcher.a(EntityFox.class, DataWatcherRegistry.o);
+ public static final DataWatcherObject<Optional<UUID>> bz = DataWatcher.a(EntityFox.class, DataWatcherRegistry.o);
private static final Predicate<EntityItem> bA = (entityitem) -> {
return !entityitem.p() && entityitem.isAlive();
};
@@ -263,8 +263,8 @@
private List<UUID> eE() {
List<UUID> list = Lists.newArrayList();
- list.add(((Optional) this.datawatcher.get(EntityFox.by)).orElse((Object) null));
- list.add(((Optional) this.datawatcher.get(EntityFox.bz)).orElse((Object) null));
+ list.add(((Optional<UUID>) this.datawatcher.get(EntityFox.by)).orElse(null)); // CraftBukkit - decompile error
+ list.add(((Optional<UUID>) this.datawatcher.get(EntityFox.bz)).orElse(null)); // CraftBukkit - decompile error
- list.add(((Optional) this.datawatcher.get(EntityFox.FIRST_TRUSTED_PLAYER)).orElse((Object) null));
- list.add(((Optional) this.datawatcher.get(EntityFox.SECOND_TRUSTED_PLAYER)).orElse((Object) null));
+ list.add((this.datawatcher.get(EntityFox.FIRST_TRUSTED_PLAYER)).orElse(null)); // CraftBukkit - decompile error
+ list.add((this.datawatcher.get(EntityFox.SECOND_TRUSTED_PLAYER)).orElse(null)); // CraftBukkit - decompile error
return list;
}

Datei anzeigen

@ -104,7 +104,7 @@
this.die();
this.a((Entity) null);
}
@@ -134,6 +170,22 @@
@@ -140,6 +176,22 @@
return false;
} else {
if (!this.dead && !this.world.isClientSide) {
@ -127,7 +127,7 @@
this.die();
this.velocityChanged();
this.a(damagesource.getEntity());
@@ -146,6 +198,18 @@
@@ -152,6 +204,18 @@
@Override
public void move(EnumMoveType enummovetype, Vec3D vec3d) {
if (!this.world.isClientSide && !this.dead && vec3d.g() > 0.0D) {
@ -146,7 +146,7 @@
this.die();
this.a((Entity) null);
}
@@ -154,7 +218,7 @@
@@ -160,7 +224,7 @@
@Override
public void h(double d0, double d1, double d2) {

Datei anzeigen

@ -327,7 +327,7 @@
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE);
}
@@ -1176,6 +1306,34 @@
@@ -1177,6 +1307,34 @@
}
}
}
@ -362,7 +362,7 @@
this.entitySleep(blockposition);
this.sleepTicks = 0;
@@ -1210,11 +1368,28 @@
@@ -1211,11 +1369,28 @@
}
public void wakeup(boolean flag, boolean flag1) {
@ -391,7 +391,7 @@
this.sleepTicks = flag ? 0 : 100;
}
@@ -1266,9 +1441,11 @@
@@ -1267,9 +1442,11 @@
this.g = blockposition;
this.bR = flag;
@ -403,7 +403,7 @@
}
}
@@ -1340,7 +1517,11 @@
@@ -1341,7 +1518,11 @@
this.setMot(vec3d2.x, d3 * 0.6D, vec3d2.z);
this.aM = f;
this.fallDistance = 0.0F;
@ -416,7 +416,7 @@
} else {
super.e(vec3d);
}
@@ -1466,12 +1647,17 @@
@@ -1467,12 +1648,17 @@
}
public void startGliding() {
@ -434,7 +434,7 @@
}
@Override
@@ -1686,26 +1872,31 @@
@@ -1687,26 +1873,31 @@
protected void releaseShoulderEntities() {
if (this.e + 20L < this.world.getTime()) {

Datei anzeigen

@ -132,9 +132,9 @@
try {
while (iterator.hasNext()) {
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
@@ -511,6 +585,12 @@
if (!mobeffect.tick(this)) {
@@ -513,6 +587,12 @@
this.a(mobeffect, true);
})) {
if (!this.world.isClientSide) {
+ // CraftBukkit start
+ EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, mobeffect, null, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.EXPIRATION);
@ -145,7 +145,7 @@
iterator.remove();
this.b(mobeffect);
}
@@ -521,6 +601,17 @@
@@ -523,6 +603,17 @@
} catch (ConcurrentModificationException concurrentmodificationexception) {
;
}
@ -163,7 +163,7 @@
if (this.updateEffects) {
if (!this.world.isClientSide) {
@@ -630,7 +721,13 @@
@@ -632,7 +723,13 @@
this.datawatcher.set(EntityLiving.e, 0);
}
@ -177,7 +177,7 @@
if (this.world.isClientSide) {
return false;
} else {
@@ -639,7 +736,14 @@
@@ -641,7 +738,14 @@
boolean flag;
for (flag = false; iterator.hasNext(); flag = true) {
@ -193,7 +193,7 @@
iterator.remove();
}
@@ -664,18 +768,44 @@
@@ -666,18 +770,44 @@
return (MobEffect) this.effects.get(mobeffectlist);
}
@ -217,7 +217,7 @@
+ // CraftBukkit start
+ boolean override = false;
+ if (mobeffect1 != null) {
+ override = new MobEffect(mobeffect1).a(mobeffect);
+ override = new MobEffect(mobeffect1).b(mobeffect);
+ }
+
+ EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, mobeffect1, mobeffect, cause, override);
@ -230,16 +230,16 @@
this.effects.put(mobeffect.getMobEffect(), mobeffect);
this.a(mobeffect);
return true;
- } else if (mobeffect1.a(mobeffect)) {
- } else if (mobeffect1.b(mobeffect)) {
+ // CraftBukkit start
+ } else if (event.isOverride()) {
+ mobeffect1.a(mobeffect);
+ mobeffect1.b(mobeffect);
this.a(mobeffect1, true);
+ // CraftBukkit end
return true;
} else {
return false;
@@ -699,13 +829,39 @@
@@ -701,13 +831,39 @@
return this.getMonsterType() == EnumMonsterType.UNDEAD;
}
@ -280,7 +280,7 @@
if (mobeffect != null) {
this.b(mobeffect);
@@ -742,20 +898,55 @@
@@ -744,20 +900,55 @@
}
@ -337,7 +337,7 @@
this.datawatcher.set(EntityLiving.HEALTH, MathHelper.a(f, 0.0F, this.getMaxHealth()));
}
@@ -765,7 +956,7 @@
@@ -767,7 +958,7 @@
return false;
} else if (this.world.isClientSide) {
return false;
@ -346,7 +346,7 @@
return false;
} else if (damagesource.isFire() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
return false;
@@ -777,17 +968,19 @@
@@ -779,17 +970,19 @@
this.ticksFarFromPlayer = 0;
float f1 = f;
@ -354,7 +354,7 @@
+ // CraftBukkit - Moved into damageEntity0(DamageSource, float)
+ if (false && (damagesource == DamageSource.ANVIL || damagesource == DamageSource.FALLING_BLOCK) && !this.getEquipment(EnumItemSlot.HEAD).isEmpty()) {
this.getEquipment(EnumItemSlot.HEAD).damage((int) (f * 4.0F + this.random.nextFloat() * f * 2.0F), this, (entityliving) -> {
entityliving.c(EnumItemSlot.HEAD);
entityliving.broadcastItemBreak(EnumItemSlot.HEAD);
});
f *= 0.75F;
}
@ -369,7 +369,7 @@
this.damageShield(f);
f2 = f;
f = 0.0F;
@@ -807,20 +1000,39 @@
@@ -809,20 +1002,39 @@
if ((float) this.noDamageTicks > 10.0F) {
if (f <= this.lastDamage) {
@ -411,7 +411,7 @@
this.ax = 0.0F;
Entity entity1 = damagesource.getEntity();
@@ -941,19 +1153,29 @@
@@ -943,19 +1155,29 @@
EnumHand[] aenumhand = EnumHand.values();
int i = aenumhand.length;
@ -445,7 +445,7 @@
EntityPlayer entityplayer = (EntityPlayer) this;
entityplayer.b(StatisticList.ITEM_USED.b(Items.TOTEM_OF_UNDYING));
@@ -961,13 +1183,15 @@
@@ -963,13 +1185,15 @@
}
this.setHealth(1.0F);
@ -465,7 +465,7 @@
}
}
@@ -1084,28 +1308,48 @@
@@ -1086,28 +1310,48 @@
boolean flag = this.lastDamageByPlayerTime > 0;
@ -516,7 +516,7 @@
}
@@ -1203,9 +1447,14 @@
@@ -1205,9 +1449,14 @@
int i = this.e(f, f1);
if (i > 0) {
@ -532,7 +532,7 @@
return true;
} else {
return flag;
@@ -1247,7 +1496,7 @@
@@ -1249,7 +1498,7 @@
protected float applyArmorModifier(DamageSource damagesource, float f) {
if (!damagesource.ignoresArmor()) {
@ -541,7 +541,7 @@
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.getAttributeInstance(GenericAttributes.ARMOR_TOUGHNESS).getValue());
}
@@ -1260,7 +1509,8 @@
@@ -1262,7 +1511,8 @@
} else {
int i;
@ -551,7 +551,7 @@
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i;
float f1 = f * (float) j;
@@ -1291,28 +1541,170 @@
@@ -1293,28 +1543,170 @@
}
}
@ -650,7 +650,7 @@
+ // Apply damage to helmet
+ if ((damagesource == DamageSource.ANVIL || damagesource == DamageSource.FALLING_BLOCK) && this.getEquipment(EnumItemSlot.HEAD) != null) {
+ this.getEquipment(EnumItemSlot.HEAD).damage((int) (event.getDamage() * 4.0F + this.random.nextFloat() * event.getDamage() * 2.0F), this, (entityliving) -> {
+ entityliving.c(EnumItemSlot.HEAD);
+ entityliving.broadcastItemBreak(EnumItemSlot.HEAD);
+ });
+ }
+
@ -732,7 +732,7 @@
}
public CombatTracker getCombatTracker() {
@@ -1399,6 +1791,7 @@
@@ -1401,6 +1793,7 @@
public AttributeMapBase getAttributeMap() {
if (this.attributeMap == null) {
this.attributeMap = new AttributeMapServer();
@ -740,7 +740,7 @@
}
return this.attributeMap;
@@ -1769,6 +2162,7 @@
@@ -1771,6 +2164,7 @@
}
if (this.onGround && !this.world.isClientSide) {
@ -748,7 +748,7 @@
this.setFlag(7, false);
}
} else {
@@ -2166,6 +2560,7 @@
@@ -2168,6 +2562,7 @@
}
if (!this.world.isClientSide) {
@ -756,7 +756,7 @@
this.setFlag(7, flag);
}
@@ -2294,12 +2689,12 @@
@@ -2296,12 +2691,12 @@
@Override
public boolean isInteractable() {
@ -771,7 +771,7 @@
}
@Override
@@ -2482,7 +2877,27 @@
@@ -2484,7 +2879,27 @@
} else {
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
this.b(this.activeItem, 16);
@ -800,7 +800,7 @@
this.dH();
}
@@ -2569,10 +2984,18 @@
@@ -2571,10 +2986,18 @@
}
if (flag2) {
@ -822,7 +822,7 @@
}
}
@@ -2659,7 +3082,7 @@
@@ -2661,7 +3084,7 @@
}
public void entityWakeup() {
@ -831,7 +831,7 @@
World world = this.world;
this.world.getClass();
@@ -2723,7 +3146,7 @@
@@ -2725,7 +3148,7 @@
Pair<MobEffect, Float> pair = (Pair) iterator.next();
if (!world.isClientSide && pair.getLeft() != null && world.random.nextFloat() < (Float) pair.getRight()) {

Datei anzeigen

@ -450,9 +450,9 @@
- this.setPositionRotation((double) i, (double) j, (double) k, f1, 0.0F);
- this.setMot(Vec3D.a);
- } else if (!worldserver1.getTravelAgent().a(this, f2)) {
- worldserver1.getTravelAgent().a((Entity) this);
- worldserver1.getTravelAgent().a(this, f2);
- } else if (!worldserver1.getTravelAgent().findAndTeleport(this, f2)) {
- worldserver1.getTravelAgent().createPortal(this);
- worldserver1.getTravelAgent().findAndTeleport(this, f2);
+ // CraftBukkit start
+ org.bukkit.World bworld = worldserver1.getWorld();
+ org.bukkit.event.world.PortalCreateEvent portalEvent = new org.bukkit.event.world.PortalCreateEvent((List<org.bukkit.block.BlockState>) (List) blockList.getList(), bworld, this.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM);
@ -714,15 +714,6 @@
}
@Override
@@ -1011,7 +1356,7 @@
}
@Override
- public void b(double d0, double d1, double d2) {
+ public void b(double d0, double d1, double d2) { // PAIL: rename to teleportAndSync
this.playerConnection.a(d0, d1, d2, this.yaw, this.pitch);
this.playerConnection.syncPosition();
}
@@ -1040,6 +1385,18 @@
@Override

Datei anzeigen

@ -43,4 +43,4 @@
+ // CraftBukkit end
this.setHasPumpkin(false);
itemstack.damage(1, entityhuman, (entityhuman1) -> {
entityhuman1.d(enumhand);
entityhuman1.broadcastItemBreak(enumhand);

Datei anzeigen

@ -19,7 +19,7 @@
+
+ @Nullable
+ public T spawnCreature(World world, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
T t0 = this.b(world, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1);
T t0 = this.createCreature(world, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1);
- world.addEntity(t0);
- return t0;

Datei anzeigen

@ -1,15 +1,15 @@
--- a/net/minecraft/server/GameRules.java
+++ b/net/minecraft/server/GameRules.java
@@ -92,7 +92,7 @@
@@ -94,7 +94,7 @@
}
public <T extends GameRules.GameRuleValue<T>> T get(GameRules.GameRuleKey<T> gamerules_gamerulekey) {
- return (GameRules.GameRuleValue) this.F.get(gamerules_gamerulekey);
+ return (T) this.F.get(gamerules_gamerulekey); // CraftBukkit - decompile error
- return (GameRules.GameRuleValue) this.H.get(gamerules_gamerulekey);
+ return (T) this.H.get(gamerules_gamerulekey); // CraftBukkit - decompile error
}
public NBTTagCompound a() {
@@ -120,7 +120,7 @@
@@ -122,7 +122,7 @@
}
private static <T extends GameRules.GameRuleValue<T>> void a(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<?> gamerules_gamerulekey, GameRules.GameRuleDefinition<?> gamerules_gameruledefinition) {
@ -18,7 +18,7 @@
}
public boolean getBoolean(GameRules.GameRuleKey<GameRules.GameRuleBoolean> gamerules_gamerulekey) {
@@ -171,7 +171,7 @@
@@ -173,7 +173,7 @@
}
@Override
@ -27,7 +27,7 @@
this.a = Boolean.parseBoolean(s);
}
@@ -221,7 +221,7 @@
@@ -223,7 +223,7 @@
}
@Override
@ -36,7 +36,7 @@
this.a = b(s);
}
@@ -270,7 +270,7 @@
@@ -272,7 +272,7 @@
}
@ -45,7 +45,7 @@
protected abstract String getValue();
@@ -300,7 +300,7 @@
@@ -302,7 +302,7 @@
}
public T getValue() {

Datei anzeigen

@ -16,13 +16,13 @@
entityboat.setType(this.b);
@@ -49,7 +57,15 @@
return InteractionResultWrapper.d(itemstack);
return InteractionResultWrapper.fail(itemstack);
} else {
if (!world.isClientSide) {
- world.addEntity(entityboat);
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(world, movingobjectpositionblock.getBlockPosition(), movingobjectpositionblock.getDirection(), entityhuman, entityboat).isCancelled()) {
+ return InteractionResultWrapper.d(itemstack);
+ return InteractionResultWrapper.fail(itemstack);
+ }
+
+ if (!world.addEntity(entityboat)) {

Datei anzeigen

@ -30,7 +30,7 @@
+ // CraftBukkit end
itemstack.damage(1, entityhuman, (entityhuman1) -> {
entityhuman1.d(entityhuman.getRaisedHand());
entityhuman1.broadcastItemBreak(entityhuman.getRaisedHand());
@@ -64,7 +75,16 @@
entityarrow.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
}

Datei anzeigen

@ -43,7 +43,7 @@
+ // CraftBukkit end
itemstack.damage(flag1 ? 3 : 1, entityliving, (entityliving1) -> {
entityliving1.d(enumhand);
entityliving1.broadcastItemBreak(enumhand);
});
- world.addEntity((Entity) object);
+ // CraftBukkit start

Datei anzeigen

@ -7,7 +7,7 @@
+ // CraftBukkit start - Store the clicked block
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition1, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, entityhuman).isCancelled()) {
+ itemactioncontext.getItemStack().damage(1, entityhuman, (entityhuman1) -> {
+ entityhuman1.d(itemactioncontext.n());
+ entityhuman1.broadcastItemBreak(itemactioncontext.getHand());
+ });
+ return EnumInteractionResult.PASS;
+ }

Datei anzeigen

@ -32,5 +32,5 @@
}
+ */
return InteractionResultWrapper.a(itemstack);
return InteractionResultWrapper.success(itemstack);
}

Datei anzeigen

@ -21,7 +21,7 @@
+ // CraftBukkit - moved down
+ /*
itemstack.damage(1, entityhuman, (entityhuman1) -> {
entityhuman1.d(entityliving.getRaisedHand());
entityhuman1.broadcastItemBreak(entityliving.getRaisedHand());
});
+ */
if (k == 0) {
@ -41,7 +41,7 @@
+ }
+
+ itemstack.damage(1, entityhuman, (entityhuman1) -> {
+ entityhuman1.d(entityliving.getRaisedHand());
+ entityhuman1.broadcastItemBreak(entityliving.getRaisedHand());
+ });
+ entitythrowntrident.trident = itemstack.cloneItemStack(); // SPIGOT-4511 update since damage call moved
+ // CraftBukkit end
@ -54,7 +54,7 @@
+ // CraftBukkit start - SPIGOT-5458 also need in this branch :(
+ else {
+ itemstack.damage(1, entityhuman, (entityhuman1) -> {
+ entityhuman1.d(entityliving.getRaisedHand());
+ entityhuman1.broadcastItemBreak(entityliving.getRaisedHand());
+ });
+ }
+ // CraftBukkkit end

Datei anzeigen

@ -57,7 +57,7 @@
+ // CraftBukkit end
} else {
this.g = LoginListener.EnumProtocolState.ACCEPTED;
if (this.server.az() >= 0 && !this.networkManager.isLocal()) {
if (this.server.aA() >= 0 && !this.networkManager.isLocal()) {
@@ -98,9 +121,9 @@
if (entityplayer != null) {

Datei anzeigen

@ -134,9 +134,9 @@
WorldNBTStorage worldnbtstorage = this.getConvertable().a(s, this);
this.a(this.getWorld(), worldnbtstorage);
@@ -282,27 +329,137 @@
}
@@ -283,27 +330,137 @@
worlddata.a(this.getServerModName(), this.q().isPresent());
this.a(worldnbtstorage.getDirectory(), worlddata);
- WorldLoadListener worldloadlistener = this.worldLoadListenerFactory.create(11);
+ */
@ -287,7 +287,7 @@
if (!worlddata.u()) {
try {
@@ -326,23 +483,8 @@
@@ -327,23 +484,8 @@
worlddata.d(true);
}
@ -312,7 +312,7 @@
private void a(WorldData worlddata) {
worlddata.f(false);
@@ -361,6 +503,23 @@
@@ -362,6 +504,23 @@
protected void a(File file, WorldData worlddata) {
this.resourcePackRepository.a((ResourcePackSource) (new ResourcePackSourceVanilla()));
this.resourcePackFolder = new ResourcePackSourceFolder(new File(file, "datapacks"));
@ -336,8 +336,8 @@
this.resourcePackRepository.a((ResourcePackSource) this.resourcePackFolder);
this.resourcePackRepository.a();
List<ResourcePackLoader> list = Lists.newArrayList();
@@ -382,11 +541,18 @@
this.ba();
@@ -383,11 +542,18 @@
this.bb();
}
- public void loadSpawn(WorldLoadListener worldloadlistener) {
@ -358,7 +358,7 @@
BlockPosition blockposition = worldserver.getSpawn();
worldloadlistener.a(new ChunkCoordIntPair(blockposition));
@@ -397,17 +563,21 @@
@@ -398,17 +564,21 @@
chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
while (chunkproviderserver.b() != 441) {
@ -389,7 +389,7 @@
if (forcedchunk != null) {
WorldServer worldserver1 = this.getWorldServer(dimensionmanager);
@@ -422,10 +592,16 @@
@@ -423,10 +593,16 @@
}
}
@ -408,7 +408,7 @@
}
protected void a(String s, WorldNBTStorage worldnbtstorage) {
@@ -472,12 +648,16 @@
@@ -473,12 +649,16 @@
}
}
@ -425,7 +425,7 @@
return flag3;
}
@@ -486,8 +666,29 @@
@@ -487,8 +667,29 @@
this.stop();
}
@ -455,7 +455,7 @@
if (this.getServerConnection() != null) {
this.getServerConnection().b();
}
@@ -496,6 +697,7 @@
@@ -497,6 +698,7 @@
MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers();
this.playerList.shutdown();
@ -463,7 +463,7 @@
}
MinecraftServer.LOGGER.info("Saving worlds");
@@ -565,14 +767,16 @@
@@ -566,14 +768,16 @@
while (this.isRunning) {
long i = SystemUtils.getMonotonicMillis() - this.nextTick;
@ -481,7 +481,7 @@
this.nextTick += 50L;
if (this.T) {
this.T = false;
@@ -619,6 +823,12 @@
@@ -620,6 +824,12 @@
} catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally {
@ -494,7 +494,7 @@
this.exit();
}
@@ -627,8 +837,15 @@
@@ -628,8 +838,15 @@
}
private boolean canSleepForTick() {
@ -511,7 +511,7 @@
protected void sleepForTick() {
this.executeAll();
@@ -729,7 +946,7 @@
@@ -735,7 +952,7 @@
this.serverPing.b().a(agameprofile);
}
@ -520,7 +520,7 @@
MinecraftServer.LOGGER.debug("Autosave started");
this.methodProfiler.enter("save");
this.playerList.savePlayers();
@@ -759,23 +976,40 @@
@@ -765,23 +982,40 @@
}
protected void b(BooleanSupplier booleansupplier) {
@ -562,7 +562,7 @@
this.methodProfiler.enter("tick");
@@ -818,7 +1052,8 @@
@@ -824,7 +1058,8 @@
this.tickables.add(runnable);
}
@ -572,7 +572,7 @@
OptionParser optionparser = new OptionParser();
OptionSpec<Void> optionspec = optionparser.accepts("nogui");
OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
@@ -841,15 +1076,17 @@
@@ -847,15 +1082,17 @@
optionparser.printHelpOn(System.err);
return;
}
@ -592,26 +592,43 @@
MinecraftServer.LOGGER.info("Initialized '" + java_nio_file_path.toAbsolutePath().toString() + "' and '" + java_nio_file_path1.toAbsolutePath().toString() + "'");
return;
}
@@ -861,14 +1098,15 @@
@@ -868,14 +1105,16 @@
CrashReport.h();
DispenserRegistry.init();
DispenserRegistry.c();
- String s = (String) optionset.valueOf(optionspec8);
+ String s = "."; // PAIL?
+ String s = (String) optionset.valueOf("universe"); // CraftBukkit
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString());
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
UserCache usercache = new UserCache(gameprofilerepository, new File(s, MinecraftServer.b.getName()));
- String s1 = (String) Optional.ofNullable(optionset.valueOf(optionspec9)).orElse(dedicatedserversettings.getProperties().levelName);
- final DedicatedServer dedicatedserver = new DedicatedServer(new File(s), dedicatedserversettings, DataConverterRegistry.a(), yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new, s1);
+ // CraftBukkit start
+ String s1 = (String) Optional.ofNullable(optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
+ final DedicatedServer dedicatedserver = new DedicatedServer(optionset, dedicatedserversettings, DataConverterRegistry.a(), yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new, s1);
+ /* CraftBukkit start
+ /*
dedicatedserver.i((String) optionset.valueOf(optionspec7));
dedicatedserver.setPort((Integer) optionset.valueOf(optionspec10));
dedicatedserver.e(optionset.has(optionspec2));
@@ -891,6 +1129,29 @@
@@ -883,12 +1122,14 @@
dedicatedserver.setForceUpgrade(optionset.has(optionspec4));
dedicatedserver.setEraseCache(optionset.has(optionspec5));
dedicatedserver.c((String) optionset.valueOf(optionspec11));
- boolean flag = !optionset.has(optionspec) && !optionset.valuesOf(nonoptionargumentspec).contains("nogui");
+ */
+ boolean flag = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");
if (flag && !GraphicsEnvironment.isHeadless()) {
dedicatedserver.bc();
}
+ /*
dedicatedserver.startServerThread();
Thread thread = new Thread("Server Shutdown Thread") {
public void run() {
@@ -898,6 +1139,29 @@
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER));
Runtime.getRuntime().addShutdownHook(thread);
@ -641,7 +658,7 @@
} catch (Exception exception) {
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
}
@@ -910,7 +1171,9 @@
@@ -917,7 +1181,9 @@
}
public void startServerThread() {
@ -651,7 +668,7 @@
}
public File d(String s) {
@@ -965,7 +1228,7 @@
@@ -972,7 +1238,7 @@
}
public String getServerModName() {
@ -660,17 +677,17 @@
}
public CrashReport b(CrashReport crashreport) {
@@ -1004,7 +1267,7 @@
}
@@ -1013,7 +1279,7 @@
public abstract Optional<String> q();
public boolean J() {
public boolean K() {
- return this.universe != null;
+ return true; // CraftBukkit
}
@Override
@@ -1720,4 +1983,16 @@
private void ba() {
@@ -1729,4 +1995,16 @@
private void bb() {
Block.REGISTRY_ID.forEach(IBlockData::c);
}
+

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/MobSpawnerPatrol.java
+++ b/net/minecraft/server/MobSpawnerPatrol.java
@@ -99,7 +99,7 @@
@@ -101,7 +101,7 @@
entitymonsterpatrolling.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
entitymonsterpatrolling.prepare(world, world.getDamageScaler(blockposition), EnumMobSpawn.PATROL, (GroupDataEntity) null, (NBTTagCompound) null);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/MobSpawnerTrader.java
+++ b/net/minecraft/server/MobSpawnerTrader.java
@@ -76,7 +76,7 @@
@@ -78,7 +78,7 @@
return false;
}
@ -9,7 +9,7 @@
if (entityvillagertrader != null) {
for (int i = 0; i < 2; ++i) {
@@ -99,7 +99,7 @@
@@ -101,7 +101,7 @@
BlockPosition blockposition = this.a(new BlockPosition(entityvillagertrader), i);
if (blockposition != null) {

Datei anzeigen

@ -81,7 +81,7 @@
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkSave();
if (completablefuture1 != completablefuture) {
@@ -496,7 +524,7 @@
@@ -500,7 +528,7 @@
return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
});
}, (runnable) -> {
@ -90,7 +90,7 @@
});
}
@@ -554,8 +582,15 @@
@@ -558,8 +586,15 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@ -107,7 +107,7 @@
if (list == null) {
list = Lists.newArrayList(new Entity[]{entity});
} else {
@@ -577,7 +612,7 @@
@@ -581,7 +616,7 @@
long i = playerchunk.i().pair();
playerchunk.getClass();
@ -116,7 +116,7 @@
});
}
@@ -594,7 +629,7 @@
@@ -598,7 +633,7 @@
return Either.left(chunk);
});
}, (runnable) -> {
@ -125,7 +125,7 @@
});
completablefuture1.thenAcceptAsync((either) -> {
@@ -608,7 +643,7 @@
@@ -612,7 +647,7 @@
return Either.left(chunk);
});
}, (runnable) -> {
@ -134,7 +134,7 @@
});
return completablefuture1;
}
@@ -622,7 +657,7 @@
@@ -626,7 +661,7 @@
return chunk;
});
}, (runnable) -> {
@ -143,7 +143,7 @@
});
}
@@ -746,7 +781,8 @@
@@ -751,7 +786,8 @@
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
});
@ -153,7 +153,7 @@
return Stream.of(chunk.getEntitySlices()).mapToInt(EntitySlice::size).sum();
}).orElse(0), optional1.map((chunk) -> {
return chunk.getTileEntities().size();
@@ -757,7 +793,7 @@
@@ -762,7 +798,7 @@
private static String a(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
try {
@ -162,7 +162,7 @@
return either != null ? (String) either.map((chunk) -> {
return "done";
@@ -775,7 +811,7 @@
@@ -780,7 +816,7 @@
private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
@ -171,7 +171,7 @@
}
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
@@ -1109,7 +1145,7 @@
@@ -1114,7 +1150,7 @@
public final Set<EntityPlayer> trackedPlayers = Sets.newHashSet();
public EntityTracker(Entity entity, int i, int j, boolean flag) {
@ -180,7 +180,7 @@
this.tracker = entity;
this.trackingDistance = i;
this.e = SectionPosition.a(entity);
@@ -1162,7 +1198,7 @@
@@ -1167,7 +1203,7 @@
public void updatePlayer(EntityPlayer entityplayer) {
if (entityplayer != this.tracker) {
@ -189,7 +189,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);
@@ -1178,6 +1214,17 @@
@@ -1183,6 +1219,17 @@
}
}

Datei anzeigen

@ -104,8 +104,8 @@
if (itemstack.getItem() instanceof ItemArmor) {
+ int finalI = i; // CraftBukkit - decompile error
itemstack.damage((int) f, this.player, (entityhuman) -> {
- entityhuman.c(EnumItemSlot.a(EnumItemSlot.Function.ARMOR, i));
+ entityhuman.c(EnumItemSlot.a(EnumItemSlot.Function.ARMOR, finalI)); // CraftBukkit - decompile error
- entityhuman.broadcastItemBreak(EnumItemSlot.a(EnumItemSlot.Function.ARMOR, i));
+ entityhuman.broadcastItemBreak(EnumItemSlot.a(EnumItemSlot.Function.ARMOR, finalI)); // CraftBukkit - decompile error
});
}
}

Datei anzeigen

@ -1,11 +1,9 @@
--- a/net/minecraft/server/PortalTravelAgent.java
+++ b/net/minecraft/server/PortalTravelAgent.java
@@ -17,13 +17,20 @@
this.b = new Random(worldserver.getSeed());
@@ -18,12 +18,19 @@
}
- public boolean a(Entity entity, float f) {
+ public boolean a(Entity entity, float f) { // PAIL: rename to findAndTeleport
public boolean findAndTeleport(Entity entity, float f) {
+ // CraftBukkit start
+ return findAndTeleport(entity, new BlockPosition(entity), f, 128, false) != null;
+ }
@ -27,7 +25,7 @@
@@ -31,19 +38,26 @@
entity.setMot(vec3d2);
entity.yaw = f + (float) shapedetector_shape.yaw;
entity.b(vec3d1.x, vec3d1.y, vec3d1.z);
entity.teleportAndSync(vec3d1.x, vec3d1.y, vec3d1.z);
- return true;
+ return shapedetector_shape; // CraftBukkit - return shape
}
@ -61,14 +59,13 @@
return shapedetector_shapedetectorcollection.a(enumdirection, blockposition1, d1, vec3d, d0);
- }).orElse((Object) null);
+ }).orElse(null); // CraftBukkit - decompile error
+ }
+
+ public boolean a(Entity entity) { // PAIL: rename to createPortal
+ // CraftBukkit start - providable position and creation radius
+ return createPortal(entity, new BlockPosition(entity), 16);
}
- public boolean a(Entity entity) {
public boolean createPortal(Entity entity) {
+ // CraftBukkit start - providable position and creation radius
+ return createPortal(entity, new BlockPosition(entity), 16);
+ }
+
+ public boolean createPortal(Entity entity, BlockPosition createPosition, int createRadius) {
+ // CraftBukkit end
boolean flag = true;

Datei anzeigen

@ -11,9 +11,9 @@
+ // CraftBukkit start
+ public void acceptConnections() {
+ synchronized (this.f) { // PAIL: listeningChannels
+ for (ChannelFuture f : this.f) {
+ f.channel().config().setAutoRead(true);
+ synchronized (this.listeningChannels) {
+ for (ChannelFuture future : this.listeningChannels) {
+ future.channel().config().setAutoRead(true);
+ }
+ }
+ }
@ -21,4 +21,4 @@
+
public void b() {
this.c = false;
Iterator iterator = this.f.iterator();
Iterator iterator = this.listeningChannels.iterator();

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityBanner.java
+++ b/net/minecraft/server/TileEntityBanner.java
@@ -69,6 +69,11 @@
@@ -70,6 +70,11 @@
}
this.patterns = nbttagcompound.getList("Patterns", 10);
@ -10,5 +10,5 @@
+ }
+ // CraftBukkit end
this.h = null;
this.i = null;
this.j = null;
this.g = true;
}

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityBeehive.java
+++ b/net/minecraft/server/TileEntityBeehive.java
@@ -161,6 +161,7 @@
@@ -163,6 +163,7 @@
if (!entity.getEntityType().a(TagsEntity.BEEHIVE_INHABITORS)) {
return false;
} else {
@ -8,7 +8,7 @@
if (entity instanceof EntityBee) {
EntityBee entitybee = (EntityBee) entity;
@@ -194,7 +195,7 @@
@@ -196,7 +197,7 @@
BlockPosition blockposition2 = this.getPosition();
this.world.playSound((EntityHuman) null, (double) blockposition2.getX(), (double) blockposition2.getY(), (double) blockposition2.getZ(), SoundEffects.BLOCK_BEEHIVE_EXIT, SoundCategory.BLOCKS, 1.0F, 1.0F);
@ -17,15 +17,15 @@
}
} else {
return false;
@@ -221,6 +222,11 @@
@@ -223,6 +224,11 @@
if (this.a(iblockdata, nbttagcompound, (List) null, tileentitybeehive_releasestatus)) {
iterator.remove();
}
+ // CraftBukkit start
+ else {
+ tileentitybeehive_a.b = tileentitybeehive_a.c / 2; // Not strictly Vanilla behaviour in cases where bees cannot spawn but still reasonable
+ tileentitybeehive_hivebee.ticksInHive = tileentitybeehive_hivebee.minOccupationTicks / 2; // Not strictly Vanilla behaviour in cases where bees cannot spawn but still reasonable
+ }
+ // CraftBukkit end
} else {
tileentitybeehive_a.b++;
tileentitybeehive_hivebee.ticksInHive++;
}

Datei anzeigen

@ -1,11 +0,0 @@
--- a/net/minecraft/server/TileEntityStructure.java
+++ b/net/minecraft/server/TileEntityStructure.java
@@ -18,7 +18,7 @@
public BlockPosition size;
public EnumBlockMirror mirror;
public EnumBlockRotation rotation;
- private BlockPropertyStructureMode usageMode;
+ public BlockPropertyStructureMode usageMode;
public boolean ignoreEntities;
private boolean powered;
public boolean showAir;

Datei anzeigen

@ -23,15 +23,6 @@
public abstract class World implements GeneratorAccess, AutoCloseable {
protected static final Logger LOGGER = LogManager.getLogger();
@@ -22,7 +38,7 @@
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();
protected final List<TileEntity> tileEntityListUnload = Lists.newArrayList();
- private final Thread serverThread;
+ final Thread serverThread; // CraftBukkit - package private // PAIL
private int c;
protected int i = (new Random()).nextInt();
protected final int j = 1013904223;
@@ -40,7 +56,51 @@
private final WorldBorder worldBorder;
private final BiomeManager biomeManager;

Datei anzeigen

@ -12,15 +12,15 @@
public class WorldData {
@@ -68,6 +73,7 @@
private UUID W;
private final GameRules X;
private final CustomFunctionCallbackTimerQueue<MinecraftServer> Y;
@@ -70,6 +75,7 @@
private boolean Y;
private final GameRules Z;
private final CustomFunctionCallbackTimerQueue<MinecraftServer> aa;
+ public WorldServer world; // CraftBukkit
protected WorldData() {
this.f = WorldType.NORMAL;
@@ -419,6 +425,7 @@
@@ -436,6 +442,7 @@
nbttagcompound.setString("WanderingTraderId", this.W.toString());
}
@ -28,7 +28,7 @@
}
public long getSeed() {
@@ -511,6 +518,20 @@
@@ -528,6 +535,20 @@
}
public void setThundering(boolean flag) {
@ -49,7 +49,7 @@
this.thundering = flag;
}
@@ -527,6 +548,20 @@
@@ -544,6 +565,20 @@
}
public void setStorm(boolean flag) {
@ -70,7 +70,7 @@
this.raining = flag;
}
@@ -676,6 +711,12 @@
@@ -693,6 +728,12 @@
public void setDifficulty(EnumDifficulty enumdifficulty) {
this.F = enumdifficulty;
@ -83,14 +83,14 @@
}
public boolean isDifficultyLocked() {
@@ -780,4 +821,12 @@
public void a(UUID uuid) {
this.W = uuid;
@@ -808,4 +849,12 @@
this.X.add(s);
this.Y |= flag;
}
+
+ // CraftBukkit start - Check if the name stored in NBT is the correct one
+ public void checkName( String name ) {
+ if ( !this.levelName.equals( name ) ) {
+ public void checkName(String name) {
+ if (!this.levelName.equals(name)) {
+ this.levelName = name;
+ }
+ }

Datei anzeigen

@ -1,11 +0,0 @@
--- a/net/minecraft/server/WorldGenStronghold.java
+++ b/net/minecraft/server/WorldGenStronghold.java
@@ -67,7 +67,7 @@
@Nullable
@Override
- public BlockPosition getNearestGeneratedFeature(World world, ChunkGenerator<? extends GeneratorSettingsDefault> chunkgenerator, BlockPosition blockposition, int i, boolean flag) {
+ public synchronized BlockPosition getNearestGeneratedFeature(World world, ChunkGenerator<? extends GeneratorSettingsDefault> chunkgenerator, BlockPosition blockposition, int i, boolean flag) { // CraftBukkit - synchronized
if (!chunkgenerator.getWorldChunkManager().a(this)) {
return null;
} else {

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/WorldGenTreeProvider.java
+++ b/net/minecraft/server/WorldGenTreeProvider.java
@@ -2,6 +2,7 @@
@@ -3,6 +3,7 @@
import java.util.Iterator;
import java.util.Random;
import javax.annotation.Nullable;
+import org.bukkit.TreeType; // CraftBukkit
public abstract class WorldGenTreeProvider {
@@ -16,6 +17,7 @@
@@ -17,6 +18,7 @@
if (worldgenfeatureconfigured == null) {
return false;
} else {
@ -16,14 +16,14 @@
generatoraccess.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 4);
((WorldGenFeatureSmallTreeConfigurationConfiguration) worldgenfeatureconfigured.c).a();
if (worldgenfeatureconfigured.a(generatoraccess, chunkgenerator, random, blockposition)) {
@@ -26,4 +28,46 @@
}
}
@@ -43,4 +45,46 @@
return true;
}
+
+ // CraftBukkit start
+ protected void setTreeType(WorldGenFeatureConfigured<?, ?> worldgentreeabstract) {
+ if (worldgentreeabstract.c == BiomeDecoratorGroups.NORMAL_TREE) {
+ if (worldgentreeabstract.c == BiomeDecoratorGroups.NORMAL_TREE || worldgentreeabstract.c == BiomeDecoratorGroups.NORMAL_TREE_BEES_005) {
+ BlockSapling.treeType = TreeType.TREE;
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.HUGE_RED_MUSHROOM) {
+ BlockSapling.treeType = TreeType.RED_MUSHROOM;
@ -39,13 +39,13 @@
+ BlockSapling.treeType = TreeType.REDWOOD;
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.ACACIA_TREE) {
+ BlockSapling.treeType = TreeType.ACACIA;
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.BIRCH_TREE) {
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.BIRCH_TREE || worldgentreeabstract.c == BiomeDecoratorGroups.BIRCH_TREE_BEES_005) {
+ BlockSapling.treeType = TreeType.BIRCH;
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.TALL_BIRCH_TREE) {
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.TALL_BIRCH_TREE_BEES_0002) {
+ BlockSapling.treeType = TreeType.TALL_BIRCH;
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.SWAMP_TREE) {
+ BlockSapling.treeType = TreeType.SWAMP;
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.FANCY_TREE) {
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.FANCY_TREE || worldgentreeabstract.c == BiomeDecoratorGroups.FANCY_TREE_BEES_005) {
+ BlockSapling.treeType = TreeType.BIG_TREE;
+ } else if (worldgentreeabstract.c == BiomeDecoratorGroups.JUNGLE_BUSH) {
+ BlockSapling.treeType = TreeType.JUNGLE_BUSH;

Datei anzeigen

@ -134,11 +134,11 @@
this.getWorldData().setDifficulty(EnumDifficulty.HARD);
}
if (this.C && this.players.stream().noneMatch((entityplayer) -> {
if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> {
- return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping();
+ return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit
})) {
- this.C = false;
- this.everyoneSleeping = false;
+ // CraftBukkit start
+ long l = this.worldData.getDayTime() + 24000L;
+ TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (l - l % 24000L) - this.getDayTime());
@ -152,10 +152,10 @@
- this.setDayTime(l - l % 24000L);
}
- this.ab();
- this.wakeupPlayers();
+ if (!event.isCancelled()) {
+ this.C = false;
+ this.ab();
+ this.everyoneSleeping = false;
+ this.wakeupPlayers();
+ }
+ // CraftBukkit end
if (this.getGameRules().getBoolean(GameRules.DO_WEATHER_CYCLE)) {
@ -201,7 +201,7 @@
@@ -312,7 +412,7 @@
}
private void ab() {
private void wakeupPlayers() {
- ((List) this.players.stream().filter(EntityLiving::isSleeping).collect(Collectors.toList())).forEach((entityplayer) -> {
+ (this.players.stream().filter(EntityLiving::isSleeping).collect(Collectors.toList())).forEach((entityplayer) -> { // CraftBukkit - decompile error
entityplayer.wakeup(false, false);
@ -277,15 +277,15 @@
}
public void resetEmptyTime() {
@@ -490,6 +602,7 @@
return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType()).toString();
@@ -493,6 +605,7 @@
});
gameprofilerfiller.c("tickNonPassenger");
entity.tick();
+ entity.postTick(); // CraftBukkit
this.getMethodProfiler().exit();
gameprofilerfiller.exit();
}
@@ -573,6 +686,22 @@
@@ -583,6 +696,22 @@
BlockPosition blockposition = worldchunkmanager.a(0, this.getSeaLevel(), 0, 256, list, random);
ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
@ -308,7 +308,7 @@
if (blockposition == null) {
WorldServer.LOGGER.warn("Unable to find spawn biome");
}
@@ -625,7 +754,7 @@
@@ -635,7 +764,7 @@
}
protected void g() {
@ -317,7 +317,7 @@
worldgenfeatureconfigured.a(this, this.getChunkProvider().getChunkGenerator(), this.random, new BlockPosition(this.worldData.b(), this.worldData.c(), this.worldData.d()));
}
@@ -639,6 +768,7 @@
@@ -649,6 +778,7 @@
ChunkProviderServer chunkproviderserver = this.getChunkProvider();
if (!flag1) {
@ -325,7 +325,7 @@
if (iprogressupdate != null) {
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
}
@@ -650,6 +780,15 @@
@@ -660,6 +790,15 @@
chunkproviderserver.save(flag);
}
@ -341,7 +341,7 @@
}
protected void m_() throws ExceptionWorldConflict {
@@ -721,7 +860,8 @@
@@ -731,7 +870,8 @@
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
@ -351,7 +351,7 @@
continue;
}
}
@@ -738,11 +878,24 @@
@@ -748,11 +888,24 @@
@Override
public boolean addEntity(Entity entity) {
@ -378,7 +378,7 @@
}
public void addEntityTeleport(Entity entity) {
@@ -792,13 +945,18 @@
@@ -802,13 +955,18 @@
this.registerEntity(entityplayer);
}
@ -399,7 +399,7 @@
IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX() / 16.0D), MathHelper.floor(entity.locZ() / 16.0D), ChunkStatus.FULL, entity.attachedToPlayer);
if (!(ichunkaccess instanceof Chunk)) {
@@ -826,7 +984,7 @@
@@ -836,7 +994,7 @@
if (entity1 == null) {
return false;
} else {
@ -408,7 +408,7 @@
return true;
}
}
@@ -877,10 +1035,17 @@
@@ -887,10 +1045,17 @@
}
this.getScoreboard().a(entity);
@ -426,7 +426,7 @@
}
private void registerEntity(Entity entity) {
@@ -901,9 +1066,16 @@
@@ -911,9 +1076,16 @@
this.entitiesByUUID.put(entity.getUniqueID(), entity);
this.getChunkProvider().addEntity(entity);
@ -443,7 +443,7 @@
}
}
@@ -934,6 +1106,18 @@
@@ -944,6 +1116,18 @@
}
public void strikeLightning(EntityLightning entitylightning) {
@ -462,7 +462,7 @@
this.globalEntityList.add(entitylightning);
this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX(), entitylightning.locY(), entitylightning.locZ(), 512.0D, this.worldProvider.getDimensionManager(), new PacketPlayOutSpawnEntityWeather(entitylightning));
}
@@ -942,6 +1126,12 @@
@@ -952,6 +1136,12 @@
public void a(int i, BlockPosition blockposition, int j) {
Iterator iterator = this.server.getPlayerList().getPlayers().iterator();
@ -475,7 +475,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -950,6 +1140,12 @@
@@ -960,6 +1150,12 @@
double d1 = (double) blockposition.getY() - entityplayer.locY();
double d2 = (double) blockposition.getZ() - entityplayer.locZ();
@ -488,7 +488,7 @@
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
}
@@ -1010,6 +1206,14 @@
@@ -1020,6 +1216,14 @@
@Override
public Explosion createExplosion(@Nullable Entity entity, @Nullable DamageSource damagesource, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
@ -503,7 +503,7 @@
Explosion explosion = new Explosion(this, entity, d0, d1, d2, f, flag, explosion_effect);
if (damagesource != null) {
@@ -1018,6 +1222,8 @@
@@ -1028,6 +1232,8 @@
explosion.a();
explosion.a(false);
@ -512,7 +512,7 @@
if (explosion_effect == Explosion.Effect.NONE) {
explosion.clearBlocks();
}
@@ -1082,13 +1288,20 @@
@@ -1092,13 +1298,20 @@
}
public <T extends ParticleParam> int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
@ -535,7 +535,7 @@
++j;
}
}
@@ -1170,7 +1383,13 @@
@@ -1180,7 +1393,13 @@
@Override
public WorldMap a(String s) {
return (WorldMap) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().b(() -> {

10
pom.xml
Datei anzeigen

@ -4,7 +4,7 @@
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<packaging>jar</packaging>
<version>1.15.1-R0.1-SNAPSHOT</version>
<version>1.15.2-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name>
<url>https://www.spigotmc.org/</url>
@ -12,7 +12,7 @@
<skipTests>true</skipTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version>
<minecraft.version>1.15.1</minecraft.version>
<minecraft.version>1.15.2</minecraft.version>
<minecraft_version>1_15_R1</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix>
@ -43,7 +43,7 @@
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>7.2</version>
<version>7.3.1</version>
<scope>compile</scope>
</dependency>
<!-- deprecated API depend -->
@ -56,7 +56,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.28.0</version>
<version>3.30.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
@ -69,7 +69,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>

Datei anzeigen

@ -718,7 +718,7 @@ public class CraftWorld implements World {
break;
case TALL_BIRCH:
gen = WorldGenerator.NORMAL_TREE;
conf = BiomeDecoratorGroups.TALL_BIRCH_TREE;
conf = BiomeDecoratorGroups.TALL_BIRCH_TREE_BEES_0002;
break;
case CHORUS_PLANT:
((BlockChorusFlower) Blocks.CHORUS_FLOWER).a(world, pos, rand, 8);
@ -1886,7 +1886,7 @@ public class CraftWorld implements World {
@Override
public void setHardcore(boolean hardcore) {
world.getWorldData().g(hardcore);
world.getWorldData().setHardcore(hardcore);
}
@Override

Datei anzeigen

@ -112,6 +112,7 @@ public class Main {
acceptsAll(asList("forceUpgrade"), "Whether to force a world upgrade");
acceptsAll(asList("eraseCache"), "Whether to force cache erase during world upgrade");
acceptsAll(asList("nogui"), "Disables the graphical console");
acceptsAll(asList("nojline"), "Disables jline and emulates the vanilla console");
@ -177,7 +178,7 @@ public class Main {
useConsole = false;
}
if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
Date buildDate = new SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor());
Calendar deadline = Calendar.getInstance();

Datei anzeigen

@ -69,7 +69,7 @@ public class CraftFox extends CraftAnimals implements Fox {
@Override
public AnimalTamer getFirstTrustedPlayer() {
UUID uuid = getHandle().getDataWatcher().get(EntityFox.by).orElse(null);
UUID uuid = getHandle().getDataWatcher().get(EntityFox.FIRST_TRUSTED_PLAYER).orElse(null);
if (uuid == null) {
return null;
}
@ -84,16 +84,16 @@ public class CraftFox extends CraftAnimals implements Fox {
@Override
public void setFirstTrustedPlayer(AnimalTamer player) {
if (player == null && getHandle().getDataWatcher().get(EntityFox.bz).isPresent()) {
if (player == null && getHandle().getDataWatcher().get(EntityFox.SECOND_TRUSTED_PLAYER).isPresent()) {
throw new IllegalStateException("Must remove second trusted player first");
}
getHandle().getDataWatcher().set(EntityFox.by, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
getHandle().getDataWatcher().set(EntityFox.FIRST_TRUSTED_PLAYER, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
}
@Override
public AnimalTamer getSecondTrustedPlayer() {
UUID uuid = getHandle().getDataWatcher().get(EntityFox.bz).orElse(null);
UUID uuid = getHandle().getDataWatcher().get(EntityFox.SECOND_TRUSTED_PLAYER).orElse(null);
if (uuid == null) {
return null;
}
@ -108,10 +108,10 @@ public class CraftFox extends CraftAnimals implements Fox {
@Override
public void setSecondTrustedPlayer(AnimalTamer player) {
if (player != null && !getHandle().getDataWatcher().get(EntityFox.by).isPresent()) {
if (player != null && !getHandle().getDataWatcher().get(EntityFox.FIRST_TRUSTED_PLAYER).isPresent()) {
throw new IllegalStateException("Must add first trusted player first");
}
getHandle().getDataWatcher().set(EntityFox.bz, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
getHandle().getDataWatcher().set(EntityFox.SECOND_TRUSTED_PLAYER, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
}
}

Datei anzeigen

@ -52,11 +52,11 @@ public abstract class CraftRaider extends CraftMonster implements Raider {
@Override
public boolean isCanJoinRaid() {
return getHandle().eD();
return getHandle().isCanJoinRaid();
}
@Override
public void setCanJoinRaid(boolean join) {
getHandle().u(join);
getHandle().setCanJoinRaid(join);
}
}

Datei anzeigen

@ -188,7 +188,7 @@ public class CraftInventoryCustom extends CraftInventory {
}
@Override
public boolean isNotEmpty() {
public boolean isEmpty() {
Iterator iterator = this.items.iterator();
ItemStack itemstack;

Datei anzeigen

@ -188,7 +188,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
* @return string
*/
public String getMappingsVersion() {
return "d2fa25e37d6e69667dc7f4a33d7644e1";
return "5684afcc1835d966e1b6eb0ed3f72edb";
}
@Override

Datei anzeigen

@ -28,7 +28,7 @@ public class TerminalConsoleWriterThread extends Thread {
// Using name from log4j config in vanilla jar
while (true) {
message = QueueLogAppender.getNextLogEvent("TerminalConsole");
message = QueueLogAppender.getNextLogEvent("ServerGuiConsole");
if (message == null) {
continue;
}

Datei anzeigen

@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="com.mojang.util">
<Appenders>
<Console name="WINDOWS_COMPAT" target="SYSTEM_OUT"></Console>
<Queue name="TerminalConsole">
<Console name="SysOut" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
</Console>
<Queue name="ServerGuiConsole">
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
</Queue>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
@ -19,10 +21,9 @@
<filters>
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
</filters>
<AppenderRef ref="WINDOWS_COMPAT"/>
<AppenderRef ref="SysOut"/>
<AppenderRef ref="File"/>
<AppenderRef ref="TerminalConsole"/>
<AppenderRef ref="ServerGuiConsole"/>
</Root>
</Loggers>
</Configuration>