Update to Minecraft 1.15.2

This commit is contained in:
md_5 2020-01-22 08:00:00 +11:00
parent 5c6b0dc6e4
commit 6881a10803
50 changed files with 293 additions and 421 deletions

View File

@ -1,13 +1,13 @@
--- a/net/minecraft/server/Advancement.java --- a/net/minecraft/server/Advancement.java
+++ b/net/minecraft/server/Advancement.java +++ b/net/minecraft/server/Advancement.java
@@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
private final String[][] f; private final String[][] requirements;
private final Set<Advancement> g = Sets.newLinkedHashSet(); private final Set<Advancement> children = Sets.newLinkedHashSet();
private final IChatBaseComponent h; private final IChatBaseComponent chatComponent;
+ public final org.bukkit.advancement.Advancement bukkit = new org.bukkit.craftbukkit.advancement.CraftAdvancement(this); // CraftBukkit + 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) { 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 @@ @@ -210,7 +211,7 @@
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -84,109 +84,16 @@
StringReader stringreader = new StringReader(s); StringReader stringreader = new StringReader(s);
if (stringreader.canRead() && stringreader.peek() == '/') { if (stringreader.canRead() && stringreader.peek() == '/') {
@@ -119,7 +173,6 @@ @@ -134,7 +188,7 @@
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()));
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) { if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor()); 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, s));
- }); + chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, label)); // CraftBukkit
});
+ chatcomponenttext = new ChatComponentText("");
if (j > 10) { if (j > 10) {
- ichatbasecomponent.a("..."); @@ -184,11 +238,36 @@
+ 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 @@
} }
public void a(EntityPlayer entityplayer) { public void a(EntityPlayer entityplayer) {
@ -224,7 +131,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode)); entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode));
} }
@@ -203,7 +285,7 @@ @@ -199,7 +278,7 @@
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next(); CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
if (commandnode2.canUse(commandlistenerwrapper)) { if (commandnode2.canUse(commandlistenerwrapper)) {
@ -233,7 +140,7 @@
argumentbuilder.requires((icompletionprovider) -> { argumentbuilder.requires((icompletionprovider) -> {
return true; return true;
@@ -226,7 +308,7 @@ @@ -222,7 +301,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect())); argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
} }

View File

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

View File

@ -3,7 +3,7 @@
@@ -54,7 +54,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.getCommandDispatcher().a();
+ return this.server.vanillaCommandDispatcher.a(); // CraftBukkit + return this.server.vanillaCommandDispatcher.a(); // CraftBukkit
} }

View File

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

View File

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

View File

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

View File

@ -1,24 +1,13 @@
--- a/net/minecraft/server/EntityFox.java --- a/net/minecraft/server/EntityFox.java
+++ b/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 @@ @@ -263,8 +263,8 @@
private List<UUID> eE() { private List<UUID> eE() {
List<UUID> list = Lists.newArrayList(); List<UUID> list = Lists.newArrayList();
- list.add(((Optional) this.datawatcher.get(EntityFox.by)).orElse((Object) null)); - list.add(((Optional) this.datawatcher.get(EntityFox.FIRST_TRUSTED_PLAYER)).orElse((Object) null));
- list.add(((Optional) this.datawatcher.get(EntityFox.bz)).orElse((Object) null)); - list.add(((Optional) this.datawatcher.get(EntityFox.SECOND_TRUSTED_PLAYER)).orElse((Object) null));
+ list.add(((Optional<UUID>) this.datawatcher.get(EntityFox.by)).orElse(null)); // CraftBukkit - decompile error + list.add((this.datawatcher.get(EntityFox.FIRST_TRUSTED_PLAYER)).orElse(null)); // CraftBukkit - decompile error
+ list.add(((Optional<UUID>) this.datawatcher.get(EntityFox.bz)).orElse(null)); // CraftBukkit - decompile error + list.add((this.datawatcher.get(EntityFox.SECOND_TRUSTED_PLAYER)).orElse(null)); // CraftBukkit - decompile error
return list; return list;
} }

View File

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

View File

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

View File

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

View File

@ -450,9 +450,9 @@
- this.setPositionRotation((double) i, (double) j, (double) k, f1, 0.0F); - this.setPositionRotation((double) i, (double) j, (double) k, f1, 0.0F);
- this.setMot(Vec3D.a); - this.setMot(Vec3D.a);
- } else if (!worldserver1.getTravelAgent().a(this, f2)) { - } else if (!worldserver1.getTravelAgent().findAndTeleport(this, f2)) {
- worldserver1.getTravelAgent().a((Entity) this); - worldserver1.getTravelAgent().createPortal(this);
- worldserver1.getTravelAgent().a(this, f2); - worldserver1.getTravelAgent().findAndTeleport(this, f2);
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.World bworld = worldserver1.getWorld(); + 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); + 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 @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 @@ @@ -1040,6 +1385,18 @@
@Override @Override

View File

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

View File

@ -19,7 +19,7 @@
+ +
+ @Nullable + @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) { + 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); - world.addEntity(t0);
- return t0; - return t0;

View File

@ -1,15 +1,15 @@
--- a/net/minecraft/server/GameRules.java --- a/net/minecraft/server/GameRules.java
+++ b/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) { public <T extends GameRules.GameRuleValue<T>> T get(GameRules.GameRuleKey<T> gamerules_gamerulekey) {
- return (GameRules.GameRuleValue) this.F.get(gamerules_gamerulekey); - return (GameRules.GameRuleValue) this.H.get(gamerules_gamerulekey);
+ return (T) this.F.get(gamerules_gamerulekey); // CraftBukkit - decompile error + return (T) this.H.get(gamerules_gamerulekey); // CraftBukkit - decompile error
} }
public NBTTagCompound a() { 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) { 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) { public boolean getBoolean(GameRules.GameRuleKey<GameRules.GameRuleBoolean> gamerules_gamerulekey) {
@@ -171,7 +171,7 @@ @@ -173,7 +173,7 @@
} }
@Override @Override
@ -27,7 +27,7 @@
this.a = Boolean.parseBoolean(s); this.a = Boolean.parseBoolean(s);
} }
@@ -221,7 +221,7 @@ @@ -223,7 +223,7 @@
} }
@Override @Override
@ -36,7 +36,7 @@
this.a = b(s); this.a = b(s);
} }
@@ -270,7 +270,7 @@ @@ -272,7 +272,7 @@
} }
@ -45,7 +45,7 @@
protected abstract String getValue(); protected abstract String getValue();
@@ -300,7 +300,7 @@ @@ -302,7 +302,7 @@
} }
public T getValue() { public T getValue() {

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
+ // CraftBukkit start - Store the clicked block + // 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()) { + 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) -> { + itemactioncontext.getItemStack().damage(1, entityhuman, (entityhuman1) -> {
+ entityhuman1.d(itemactioncontext.n()); + entityhuman1.broadcastItemBreak(itemactioncontext.getHand());
+ }); + });
+ return EnumInteractionResult.PASS; + return EnumInteractionResult.PASS;
+ } + }

View File

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

View File

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

View File

@ -57,7 +57,7 @@
+ // CraftBukkit end + // CraftBukkit end
} else { } else {
this.g = LoginListener.EnumProtocolState.ACCEPTED; 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 @@ @@ -98,9 +121,9 @@
if (entityplayer != null) { if (entityplayer != null) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityBanner.java --- a/net/minecraft/server/TileEntityBanner.java
+++ b/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); this.patterns = nbttagcompound.getList("Patterns", 10);
@ -10,5 +10,5 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.h = null; this.h = null;
this.i = null; this.g = true;
this.j = null; }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityBeehive.java --- a/net/minecraft/server/TileEntityBeehive.java
+++ b/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)) { if (!entity.getEntityType().a(TagsEntity.BEEHIVE_INHABITORS)) {
return false; return false;
} else { } else {
@ -8,7 +8,7 @@
if (entity instanceof EntityBee) { if (entity instanceof EntityBee) {
EntityBee entitybee = (EntityBee) entity; EntityBee entitybee = (EntityBee) entity;
@@ -194,7 +195,7 @@ @@ -196,7 +197,7 @@
BlockPosition blockposition2 = this.getPosition(); 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); 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 { } else {
return false; return false;
@@ -221,6 +222,11 @@ @@ -223,6 +224,11 @@
if (this.a(iblockdata, nbttagcompound, (List) null, tileentitybeehive_releasestatus)) { if (this.a(iblockdata, nbttagcompound, (List) null, tileentitybeehive_releasestatus)) {
iterator.remove(); iterator.remove();
} }
+ // CraftBukkit start + // CraftBukkit start
+ else { + 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 + // CraftBukkit end
} else { } else {
tileentitybeehive_a.b++; tileentitybeehive_hivebee.ticksInHive++;
} }

View File

@ -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;

View File

@ -23,15 +23,6 @@
public abstract class World implements GeneratorAccess, AutoCloseable { public abstract class World implements GeneratorAccess, AutoCloseable {
protected static final Logger LOGGER = LogManager.getLogger(); 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 @@ @@ -40,7 +56,51 @@
private final WorldBorder worldBorder; private final WorldBorder worldBorder;
private final BiomeManager biomeManager; private final BiomeManager biomeManager;

View File

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

View File

@ -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 {

View File

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

View File

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

10
pom.xml
View File

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

View File

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

View File

@ -112,6 +112,7 @@ public class Main {
acceptsAll(asList("forceUpgrade"), "Whether to force a world upgrade"); acceptsAll(asList("forceUpgrade"), "Whether to force a world upgrade");
acceptsAll(asList("eraseCache"), "Whether to force cache erase during 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"); acceptsAll(asList("nojline"), "Disables jline and emulates the vanilla console");
@ -177,7 +178,7 @@ public class Main {
useConsole = false; 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()); Date buildDate = new SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor());
Calendar deadline = Calendar.getInstance(); Calendar deadline = Calendar.getInstance();

View File

@ -69,7 +69,7 @@ public class CraftFox extends CraftAnimals implements Fox {
@Override @Override
public AnimalTamer getFirstTrustedPlayer() { 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) { if (uuid == null) {
return null; return null;
} }
@ -84,16 +84,16 @@ public class CraftFox extends CraftAnimals implements Fox {
@Override @Override
public void setFirstTrustedPlayer(AnimalTamer player) { 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"); 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 @Override
public AnimalTamer getSecondTrustedPlayer() { 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) { if (uuid == null) {
return null; return null;
} }
@ -108,10 +108,10 @@ public class CraftFox extends CraftAnimals implements Fox {
@Override @Override
public void setSecondTrustedPlayer(AnimalTamer player) { 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"); 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()));
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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