1
0
forked from xjboss/KCauldronX

Update to Forge 10.13.3.1388. Small fixes.

This commit is contained in:
gamerforEA 2015-04-24 15:40:52 +03:00
parent 8bd7ff1755
commit d5cf443039
23 changed files with 237 additions and 110 deletions

View File

@ -44,7 +44,7 @@ minecraft {
group = 'net.minecraftforge' group = 'net.minecraftforge'
ext.mcVersion = "1.7.10" ext.mcVersion = "1.7.10"
ext.cauldronVersion = "1" ext.cauldronVersion = "1"
ext.forgeVersion = "1370" ext.forgeVersion = "1388"
ext.bukkitVersion = "1" ext.bukkitVersion = "1"
version = "${mcVersion}-${cauldronVersion}.${forgeVersion}.${bukkitVersion}.0" version = "${mcVersion}-${cauldronVersion}.${forgeVersion}.${bukkitVersion}.0"
@ -65,7 +65,7 @@ tasks.packageUniversal.manifest {
'Implementation-Vendor': 'Cauldron', 'Implementation-Vendor': 'Cauldron',
'Implementation-Title': 'Cauldron', 'Implementation-Title': 'Cauldron',
'Implementation-Version': 'git-Cauldron-Reloaded-'+project.version, 'Implementation-Version': 'git-Cauldron-Reloaded-'+project.version,
'Forge-Version': '10.13.3.1370', 'Forge-Version': '10.13.3.1388',
'Specification-Vendor': 'Bukkit Team', 'Specification-Vendor': 'Bukkit Team',
'Specification-Title': 'Bukkit', 'Specification-Title': 'Bukkit',
'Specification-Version': '1.7.10-R0.1-SNAPSHOT' 'Specification-Version': '1.7.10-R0.1-SNAPSHOT'

View File

@ -56,9 +56,9 @@
+ if ((entityName.indexOf(".") + 1) < entityName.length()) + if ((entityName.indexOf(".") + 1) < entityName.length())
+ entityName = entityName.substring(entityName.indexOf(".") + 1, entityName.length()); + entityName = entityName.substring(entityName.indexOf(".") + 1, entityName.length());
+ } + }
+ entityName.replace("entity", ""); + entityName = entityName.replace("entity", "");
+ if (entityName.startsWith("ent")) + if (entityName.startsWith("ent"))
+ entityName.replace("ent", ""); + entityName = entityName.replace("ent", "");
+ entityName = entityName.replaceAll("[^A-Za-z0-9]", ""); // remove all non-digits/alphanumeric + entityName = entityName.replaceAll("[^A-Za-z0-9]", ""); // remove all non-digits/alphanumeric
+ if (activeModContainer != null) + if (activeModContainer != null)
+ modId = activeModContainer.getModId(); + modId = activeModContainer.getModId();

View File

@ -27,7 +27,7 @@
+ // Cauldron start - mod id's are not available during generateWorld so we must capture them here + // Cauldron start - mod id's are not available during generateWorld so we must capture them here
+ String modId = Loader.instance().activeModContainer().getModId(); + String modId = Loader.instance().activeModContainer().getModId();
+ modId = modId.replaceAll("[^A-Za-z0-9]", ""); // remove all non-digits/alphanumeric + modId = modId.replaceAll("[^A-Za-z0-9]", ""); // remove all non-digits/alphanumeric
+ modId.replace(" ", "_"); + modId = modId.replace(" ", "_");
worldGenerators.add(generator); worldGenerators.add(generator);
worldGeneratorIndex.put(generator, modGenerationWeight); worldGeneratorIndex.put(generator, modGenerationWeight);
if (sortedGeneratorList != null) if (sortedGeneratorList != null)

View File

@ -40,7 +40,7 @@
+ { + {
+ cancellable = CraftEventFactory.callPlayerInteractEvent((EntityPlayer) p_149746_5_, org.bukkit.event.block.Action.PHYSICAL, p_149746_2_, p_149746_3_, p_149746_4_, -1, null); + cancellable = CraftEventFactory.callPlayerInteractEvent((EntityPlayer) p_149746_5_, org.bukkit.event.block.Action.PHYSICAL, p_149746_2_, p_149746_3_, p_149746_4_, -1, null);
+ } + }
+ else if (p_149746_1_ != null && p_149746_1_.getWorld() != null && p_149746_5_ != null) + else if (p_149746_1_.getWorld() != null && p_149746_5_ != null)
+ { + {
+ cancellable = new EntityInteractEvent(p_149746_5_.getBukkitEntity(), p_149746_1_.getWorld().getBlockAt(p_149746_2_, p_149746_3_, p_149746_4_)); + cancellable = new EntityInteractEvent(p_149746_5_.getBukkitEntity(), p_149746_1_.getWorld().getBlockAt(p_149746_2_, p_149746_3_, p_149746_4_));
+ p_149746_1_.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable); + p_149746_1_.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable);

View File

@ -18,7 +18,7 @@
if (!p_77648_3_.isRemote) if (!p_77648_3_.isRemote)
{ {
+ // CraftBukkit start + // CraftBukkit start
+ Player who = (p_77648_2_ == null) ? null : (Player) p_77648_2_.getBukkitEntity(); + Player who = (Player) p_77648_2_.getBukkitEntity();
+ org.bukkit.block.Block blockClicked = p_77648_3_.getWorld().getBlockAt(p_77648_4_, p_77648_5_, p_77648_6_); + org.bukkit.block.Block blockClicked = p_77648_3_.getWorld().getBlockAt(p_77648_4_, p_77648_5_, p_77648_6_);
+ org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(p_77648_7_); + org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(p_77648_7_);
+ HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) entityhanging.getBukkitEntity(), who, blockClicked, blockFace); + HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) entityhanging.getBukkitEntity(), who, blockClicked, blockFace);

View File

@ -12,7 +12,12 @@
public class ItemMap extends ItemMapBase public class ItemMap extends ItemMapBase
{ {
private static final String __OBFID = "CL_00000047"; private static final String __OBFID = "CL_00000047";
@@ -60,6 +65,10 @@ @@ -56,10 +61,14 @@
mapdata.scale = 3;
int i = 128 * (1 << mapdata.scale);
mapdata.xCenter = Math.round((float)p_77873_2_.getWorldInfo().getSpawnX() / (float)i) * i;
- mapdata.zCenter = Math.round((float)(p_77873_2_.getWorldInfo().getSpawnZ() / i)) * i;
+ mapdata.zCenter = Math.round((float) p_77873_2_.getWorldInfo().getSpawnZ() / (float)i) * i;
mapdata.dimension = p_77873_2_.provider.dimensionId; mapdata.dimension = p_77873_2_.provider.dimensionId;
mapdata.markDirty(); mapdata.markDirty();
p_77873_2_.setItemData(s, mapdata); p_77873_2_.setItemData(s, mapdata);

View File

@ -231,7 +231,7 @@
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
this.field_147366_g = true; this.field_147366_g = true;
@@ -199,8 +323,78 @@ @@ -199,8 +323,70 @@
} }
} }
@ -268,40 +268,32 @@
+ this.lastYaw = to.getYaw(); + this.lastYaw = to.getYaw();
+ this.lastPitch = to.getPitch(); + this.lastPitch = to.getPitch();
+ +
+ // Skip the first time we do this + PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
+ if (hasMoved) // Spigot - Better Check! + this.server.getPluginManager().callEvent(event);
+
+ // If the event is cancelled we move the player back to their old location.
+ if (event.isCancelled())
+ { + {
+ PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); + this.playerEntity.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(from.getX(), from.getY() + 1.6200000047683716D, from
+ this.server.getPluginManager().callEvent(event); + .getZ(), from.getYaw(), from.getPitch(), false));
+ + return;
+ // If the event is cancelled we move the player back to their old location.
+ if (event.isCancelled())
+ {
+ this.playerEntity.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(from.getX(), from.getY() + 1.6200000047683716D, from
+ .getZ(), from.getYaw(), from.getPitch(), false));
+ return;
+ }
+
+ /* If a Plugin has changed the To destination then we teleport the Player
+ there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
+ We only do this if the Event was not cancelled. */
+ if (!to.equals(event.getTo()) && !event.isCancelled())
+ {
+ this.playerEntity.getBukkitEntity().teleport(event.getTo(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
+ return;
+ }
+
+ /* Check to see if the Players Location has some how changed during the call of the event.
+ This can happen due to a plugin teleporting the player instead of using .setTo() */
+ if (!from.equals(this.getPlayerB().getLocation()) && this.justTeleported)
+ {
+ this.justTeleported = false;
+ return;
+ }
+ } + }
+ else +
+ /* If a Plugin has changed the To destination then we teleport the Player
+ there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
+ We only do this if the Event was not cancelled. */
+ if (!to.equals(event.getTo()) && !event.isCancelled())
+ { + {
+ hasMoved = true; // Spigot - Better Check! + this.playerEntity.getBukkitEntity().teleport(event.getTo(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
+ return;
+ }
+
+ /* Check to see if the Players Location has some how changed during the call of the event.
+ This can happen due to a plugin teleporting the player instead of using .setTo() */
+ if (!from.equals(this.getPlayerB().getLocation()) && this.justTeleported)
+ {
+ this.justTeleported = false;
+ return;
+ } + }
+ } + }
+ +
@ -311,7 +303,7 @@
double d1; double d1;
double d2; double d2;
double d3; double d3;
@@ -280,13 +474,6 @@ @@ -280,13 +466,6 @@
d3 = p_147347_1_.func_149472_e(); d3 = p_147347_1_.func_149472_e();
d4 = p_147347_1_.func_149471_f() - p_147347_1_.func_149467_d(); d4 = p_147347_1_.func_149471_f() - p_147347_1_.func_149467_d();
@ -325,7 +317,7 @@
if (Math.abs(p_147347_1_.func_149464_c()) > 3.2E7D || Math.abs(p_147347_1_.func_149472_e()) > 3.2E7D) if (Math.abs(p_147347_1_.func_149464_c()) > 3.2E7D || Math.abs(p_147347_1_.func_149472_e()) > 3.2E7D)
{ {
this.kickPlayerFromServer("Illegal position"); this.kickPlayerFromServer("Illegal position");
@@ -318,7 +505,7 @@ @@ -318,7 +497,7 @@
double d9 = Math.max(Math.abs(d6), Math.abs(this.playerEntity.motionZ)); double d9 = Math.max(Math.abs(d6), Math.abs(this.playerEntity.motionZ));
double d10 = d7 * d7 + d8 * d8 + d9 * d9; double d10 = d7 * d7 + d8 * d8 + d9 * d9;
@ -334,7 +326,7 @@
{ {
logger.warn(this.playerEntity.getCommandSenderName() + " moved too quickly! " + d4 + "," + d5 + "," + d6 + " (" + d7 + ", " + d8 + ", " + d9 + ")"); logger.warn(this.playerEntity.getCommandSenderName() + " moved too quickly! " + d4 + "," + d5 + "," + d6 + " (" + d7 + ", " + d8 + ", " + d9 + ")");
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch);
@@ -413,21 +600,85 @@ @@ -413,21 +592,85 @@
public void setPlayerLocation(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_) public void setPlayerLocation(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_)
{ {
@ -425,7 +417,7 @@
this.playerEntity.dropOneItem(false); this.playerEntity.dropOneItem(false);
} }
else if (p_147345_1_.func_149506_g() == 3) else if (p_147345_1_.func_149506_g() == 3)
@@ -490,7 +741,17 @@ @@ -490,7 +733,17 @@
} }
else else
{ {
@ -443,7 +435,7 @@
} }
} }
else if (p_147345_1_.func_149506_g() == 2) else if (p_147345_1_.func_149506_g() == 2)
@@ -517,6 +778,34 @@ @@ -517,6 +770,34 @@
public void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement p_147346_1_) public void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement p_147346_1_)
{ {
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
@ -478,7 +470,7 @@
ItemStack itemstack = this.playerEntity.inventory.getCurrentItem(); ItemStack itemstack = this.playerEntity.inventory.getCurrentItem();
boolean flag = false; boolean flag = false;
boolean placeResult = true; boolean placeResult = true;
@@ -533,11 +822,21 @@ @@ -533,11 +814,21 @@
return; return;
} }
@ -502,7 +494,7 @@
} }
else if (p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit())) else if (p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit()))
{ {
@@ -548,17 +847,24 @@ @@ -548,17 +839,24 @@
} }
else else
{ {
@ -535,7 +527,7 @@
flag = true; flag = true;
} }
@@ -615,7 +921,7 @@ @@ -615,7 +913,7 @@
this.playerEntity.openContainer.detectAndSendChanges(); this.playerEntity.openContainer.detectAndSendChanges();
this.playerEntity.isChangingQuantityOnly = false; this.playerEntity.isChangingQuantityOnly = false;
@ -544,7 +536,7 @@
{ {
this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem()));
} }
@@ -624,14 +930,34 @@ @@ -624,14 +922,34 @@
public void onDisconnect(IChatComponent p_147231_1_) public void onDisconnect(IChatComponent p_147231_1_)
{ {
@ -584,7 +576,7 @@
if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner())) if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner()))
{ {
logger.info("Stopping singleplayer server as player logged out"); logger.info("Stopping singleplayer server as player logged out");
@@ -657,6 +983,18 @@ @@ -657,6 +975,18 @@
} }
} }
@ -603,7 +595,7 @@
try try
{ {
this.netManager.scheduleOutboundPacket(p_147359_1_, new GenericFutureListener[0]); this.netManager.scheduleOutboundPacket(p_147359_1_, new GenericFutureListener[0]);
@@ -679,20 +1017,37 @@ @@ -679,20 +1009,37 @@
public void processHeldItemChange(C09PacketHeldItemChange p_147355_1_) public void processHeldItemChange(C09PacketHeldItemChange p_147355_1_)
{ {
@ -642,7 +634,7 @@
{ {
ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.cannotSend", new Object[0]); ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.cannotSend", new Object[0]);
chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED);
@@ -708,51 +1063,385 @@ @@ -708,51 +1055,385 @@
{ {
if (!ChatAllowedCharacters.isAllowedCharacter(s.charAt(i))) if (!ChatAllowedCharacters.isAllowedCharacter(s.charAt(i)))
{ {
@ -1040,7 +1032,7 @@
if (p_147357_1_.func_149513_d() == 1) if (p_147357_1_.func_149513_d() == 1)
{ {
this.playerEntity.setSneaking(true); this.playerEntity.setSneaking(true);
@@ -772,7 +1461,7 @@ @@ -772,7 +1453,7 @@
else if (p_147357_1_.func_149513_d() == 3) else if (p_147357_1_.func_149513_d() == 3)
{ {
this.playerEntity.wakeUpPlayer(false, true, true); this.playerEntity.wakeUpPlayer(false, true, true);
@ -1049,7 +1041,7 @@
} }
else if (p_147357_1_.func_149513_d() == 6) else if (p_147357_1_.func_149513_d() == 6)
{ {
@@ -789,8 +1478,20 @@ @@ -789,8 +1470,20 @@
public void processUseEntity(C02PacketUseEntity p_147340_1_) public void processUseEntity(C02PacketUseEntity p_147340_1_)
{ {
@ -1071,7 +1063,7 @@
this.playerEntity.func_143004_u(); this.playerEntity.func_143004_u();
if (entity != null) if (entity != null)
@@ -805,9 +1506,53 @@ @@ -805,9 +1498,53 @@
if (this.playerEntity.getDistanceSqToEntity(entity) < d0) if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
{ {
@ -1125,7 +1117,7 @@
} }
else if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK) else if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK)
{ {
@@ -819,6 +1564,13 @@ @@ -819,6 +1556,13 @@
} }
this.playerEntity.attackTargetEntityWithCurrentItem(entity); this.playerEntity.attackTargetEntityWithCurrentItem(entity);
@ -1139,7 +1131,7 @@
} }
} }
} }
@@ -834,8 +1586,19 @@ @@ -834,8 +1578,19 @@
case 1: case 1:
if (this.playerEntity.playerConqueredTheEnd) if (this.playerEntity.playerConqueredTheEnd)
{ {
@ -1160,7 +1152,7 @@
else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled())
{ {
if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner())) if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner()))
@@ -871,17 +1634,461 @@ @@ -871,17 +1626,461 @@
public void processCloseWindow(C0DPacketCloseWindow p_147356_1_) public void processCloseWindow(C0DPacketCloseWindow p_147356_1_)
{ {
@ -1623,7 +1615,7 @@
if (ItemStack.areItemStacksEqual(p_147351_1_.func_149546_g(), itemstack)) if (ItemStack.areItemStacksEqual(p_147351_1_.func_149546_g(), itemstack))
{ {
this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true)); this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true));
@@ -903,6 +2110,12 @@ @@ -903,6 +2102,12 @@
} }
this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, arraylist); this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, arraylist);
@ -1636,7 +1628,7 @@
} }
} }
} }
@@ -925,9 +2138,61 @@ @@ -925,9 +2130,61 @@
boolean flag = p_147344_1_.func_149627_c() < 0; boolean flag = p_147344_1_.func_149627_c() < 0;
ItemStack itemstack = p_147344_1_.func_149625_d(); ItemStack itemstack = p_147344_1_.func_149625_d();
boolean flag1 = p_147344_1_.func_149627_c() >= 1 && p_147344_1_.func_149627_c() < 36 + InventoryPlayer.getHotbarSize(); boolean flag1 = p_147344_1_.func_149627_c() >= 1 && p_147344_1_.func_149627_c() < 36 + InventoryPlayer.getHotbarSize();
@ -1699,7 +1691,7 @@
if (flag1 && flag2 && flag3) if (flag1 && flag2 && flag3)
{ {
if (itemstack == null) if (itemstack == null)
@@ -956,6 +2221,11 @@ @@ -956,6 +2213,11 @@
public void processConfirmTransaction(C0FPacketConfirmTransaction p_147339_1_) public void processConfirmTransaction(C0FPacketConfirmTransaction p_147339_1_)
{ {
@ -1711,7 +1703,7 @@
Short oshort = (Short)this.field_147372_n.lookup(this.playerEntity.openContainer.windowId); Short oshort = (Short)this.field_147372_n.lookup(this.playerEntity.openContainer.windowId);
if (oshort != null && p_147339_1_.func_149533_d() == oshort.shortValue() && this.playerEntity.openContainer.windowId == p_147339_1_.func_149532_c() && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) if (oshort != null && p_147339_1_.func_149533_d() == oshort.shortValue() && this.playerEntity.openContainer.windowId == p_147339_1_.func_149532_c() && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
@@ -966,6 +2236,11 @@ @@ -966,6 +2228,11 @@
public void processUpdateSign(C12PacketUpdateSign p_147343_1_) public void processUpdateSign(C12PacketUpdateSign p_147343_1_)
{ {
@ -1723,7 +1715,7 @@
this.playerEntity.func_143004_u(); this.playerEntity.func_143004_u();
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
@@ -980,6 +2255,7 @@ @@ -980,6 +2247,7 @@
if (!tileentitysign.func_145914_a() || tileentitysign.func_145911_b() != this.playerEntity) if (!tileentitysign.func_145914_a() || tileentitysign.func_145911_b() != this.playerEntity)
{ {
this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign"); this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign");
@ -1731,7 +1723,7 @@
return; return;
} }
} }
@@ -990,6 +2266,7 @@ @@ -990,6 +2258,7 @@
for (j = 0; j < 4; ++j) for (j = 0; j < 4; ++j)
{ {
boolean flag = true; boolean flag = true;
@ -1739,7 +1731,7 @@
if (p_147343_1_.func_149589_f()[j].length() > 15) if (p_147343_1_.func_149589_f()[j].length() > 15)
{ {
@@ -1018,7 +2295,29 @@ @@ -1018,7 +2287,29 @@
int k = p_147343_1_.func_149586_d(); int k = p_147343_1_.func_149586_d();
i = p_147343_1_.func_149585_e(); i = p_147343_1_.func_149585_e();
TileEntitySign tileentitysign1 = (TileEntitySign)tileentity; TileEntitySign tileentitysign1 = (TileEntitySign)tileentity;
@ -1770,7 +1762,7 @@
tileentitysign1.markDirty(); tileentitysign1.markDirty();
worldserver.markBlockForUpdate(j, k, i); worldserver.markBlockForUpdate(j, k, i);
} }
@@ -1041,7 +2340,22 @@ @@ -1041,7 +2332,22 @@
public void processPlayerAbilities(C13PacketPlayerAbilities p_147348_1_) public void processPlayerAbilities(C13PacketPlayerAbilities p_147348_1_)
{ {
@ -1794,7 +1786,7 @@
} }
public void processTabComplete(C14PacketTabComplete p_147341_1_) public void processTabComplete(C14PacketTabComplete p_147341_1_)
@@ -1068,7 +2382,6 @@ @@ -1068,7 +2374,6 @@
PacketBuffer packetbuffer; PacketBuffer packetbuffer;
ItemStack itemstack; ItemStack itemstack;
ItemStack itemstack1; ItemStack itemstack1;
@ -1802,7 +1794,7 @@
if ("MC|BEdit".equals(p_147349_1_.func_149559_c())) if ("MC|BEdit".equals(p_147349_1_.func_149559_c()))
{ {
packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e())); packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e()));
@@ -1093,16 +2406,18 @@ @@ -1093,16 +2398,18 @@
if (itemstack.getItem() == Items.writable_book && itemstack.getItem() == itemstack1.getItem()) if (itemstack.getItem() == Items.writable_book && itemstack.getItem() == itemstack1.getItem())
{ {
@ -1825,7 +1817,7 @@
} }
finally finally
{ {
@@ -1135,19 +2450,18 @@ @@ -1135,19 +2442,18 @@
{ {
if (itemstack.getItem() == Items.written_book && itemstack1.getItem() == Items.writable_book) if (itemstack.getItem() == Items.written_book && itemstack1.getItem() == Items.writable_book)
{ {
@ -1851,7 +1843,7 @@
} }
finally finally
{ {
@@ -1174,9 +2488,12 @@ @@ -1174,9 +2480,12 @@
((ContainerMerchant)container).setCurrentRecipeIndex(i); ((ContainerMerchant)container).setCurrentRecipeIndex(i);
} }
} }
@ -1865,7 +1857,7 @@
} }
} }
else if ("MC|AdvCdm".equals(p_147349_1_.func_149559_c())) else if ("MC|AdvCdm".equals(p_147349_1_.func_149559_c()))
@@ -1222,9 +2539,12 @@ @@ -1222,9 +2531,12 @@
this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.setCommand.success", new Object[] {s1})); this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.setCommand.success", new Object[] {s1}));
} }
} }
@ -1880,7 +1872,7 @@
} }
finally finally
{ {
@@ -1257,9 +2577,12 @@ @@ -1257,9 +2569,12 @@
tileentitybeacon.markDirty(); tileentitybeacon.markDirty();
} }
} }
@ -1895,7 +1887,7 @@
} }
} }
} }
@@ -1281,6 +2604,13 @@ @@ -1281,6 +2596,13 @@
containerrepair.updateItemName(""); containerrepair.updateItemName("");
} }
} }
@ -1909,7 +1901,7 @@
} }
} }
@@ -1292,6 +2622,21 @@ @@ -1292,6 +2614,21 @@
} }
} }

View File

@ -29,7 +29,7 @@
private ServerEula field_154332_n; private ServerEula field_154332_n;
private boolean canSpawnStructures; private boolean canSpawnStructures;
private WorldSettings.GameType gameType; private WorldSettings.GameType gameType;
@@ -52,9 +62,12 @@ @@ -52,10 +62,13 @@
public static boolean allowPlayerLogins = false; public static boolean allowPlayerLogins = false;
private static final String __OBFID = "CL_00001784"; private static final String __OBFID = "CL_00001784";
@ -38,12 +38,14 @@
+ public DedicatedServer(joptsimple.OptionSet options) + public DedicatedServer(joptsimple.OptionSet options)
{ {
- super(p_i1508_1_, Proxy.NO_PROXY); - super(p_i1508_1_, Proxy.NO_PROXY);
- Thread thread = new Thread("Server Infinisleeper")
+ super(options, Proxy.NO_PROXY); + super(options, Proxy.NO_PROXY);
+ // super(p_i1508_1_, Proxy.NO_PROXY); + // super(p_i1508_1_, Proxy.NO_PROXY);
+ // CraftBukkit end + // CraftBukkit end
Thread thread = new Thread("Server Infinisleeper") + new Thread("Server Infinisleeper")
{ {
private static final String __OBFID = "CL_00001787"; private static final String __OBFID = "CL_00001787";
{
@@ -82,31 +95,77 @@ @@ -82,31 +95,77 @@
}; };
} }

View File

@ -18,8 +18,8 @@
import net.minecraft.world.WorldSettings; import net.minecraft.world.WorldSettings;
import net.minecraft.world.demo.DemoWorldManager; import net.minecraft.world.demo.DemoWorldManager;
import net.minecraft.world.storage.IPlayerFileData; import net.minecraft.world.storage.IPlayerFileData;
+import net.minecraftforge.common.DimensionManager;
import net.minecraft.world.storage.SaveHandler; import net.minecraft.world.storage.SaveHandler;
+import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.chunkio.ChunkIOExecutor; import net.minecraftforge.common.chunkio.ChunkIOExecutor;
+import net.minecraftforge.common.network.ForgeMessage; +import net.minecraftforge.common.network.ForgeMessage;
+import net.minecraftforge.common.network.ForgeNetworkHandler; +import net.minecraftforge.common.network.ForgeNetworkHandler;
@ -135,16 +135,15 @@
{ {
HashSet hashset = new HashSet(); HashSet hashset = new HashSet();
Iterator iterator = p_96456_1_.getTeams().iterator(); Iterator iterator = p_96456_1_.getTeams().iterator();
@@ -225,6 +280,8 @@ @@ -225,6 +280,7 @@
public void setPlayerManager(WorldServer[] p_72364_1_) public void setPlayerManager(WorldServer[] p_72364_1_)
{ {
+ if (this.playerNBTManagerObj != null) return; // CraftBukkit + if (this.playerNBTManagerObj != null) return; // CraftBukkit
+
this.playerNBTManagerObj = p_72364_1_[0].getSaveHandler().getSaveHandler(); this.playerNBTManagerObj = p_72364_1_[0].getSaveHandler().getSaveHandler();
} }
@@ -248,7 +305,7 @@ @@ -248,7 +304,7 @@
public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP p_72380_1_) public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP p_72380_1_)
{ {
@ -153,7 +152,7 @@
NBTTagCompound nbttagcompound1; NBTTagCompound nbttagcompound1;
if (p_72380_1_.getCommandSenderName().equals(this.mcServer.getServerOwner()) && nbttagcompound != null) if (p_72380_1_.getCommandSenderName().equals(this.mcServer.getServerOwner()) && nbttagcompound != null)
@@ -294,18 +351,61 @@ @@ -294,18 +350,60 @@
public void playerLoggedIn(EntityPlayerMP p_72377_1_) public void playerLoggedIn(EntityPlayerMP p_72377_1_)
{ {
@ -195,7 +194,6 @@
{ {
EntityPlayerMP entityplayermp1 = (EntityPlayerMP)this.playerEntityList.get(i); EntityPlayerMP entityplayermp1 = (EntityPlayerMP)this.playerEntityList.get(i);
- p_72377_1_.playerNetServerHandler.sendPacket(new S38PacketPlayerListItem(entityplayermp1.getCommandSenderName(), true, entityplayermp1.ping)); - p_72377_1_.playerNetServerHandler.sendPacket(new S38PacketPlayerListItem(entityplayermp1.getCommandSenderName(), true, entityplayermp1.ping));
+
+ if (entityplayermp1.getBukkitEntity().canSee(p_72377_1_.getBukkitEntity())) + if (entityplayermp1.getBukkitEntity().canSee(p_72377_1_.getBukkitEntity()))
+ { + {
+ entityplayermp1.playerNetServerHandler.sendPacket(packet); + entityplayermp1.playerNetServerHandler.sendPacket(packet);
@ -219,7 +217,7 @@
} }
public void updatePlayerPertinentChunks(EntityPlayerMP p_72358_1_) public void updatePlayerPertinentChunks(EntityPlayerMP p_72358_1_)
@@ -313,14 +413,33 @@ @@ -313,14 +411,33 @@
p_72358_1_.getServerForPlayer().getPlayerManager().updatePlayerPertinentChunks(p_72358_1_); p_72358_1_.getServerForPlayer().getPlayerManager().updatePlayerPertinentChunks(p_72358_1_);
} }
@ -229,8 +227,8 @@
- FMLCommonHandler.instance().firePlayerLoggedOut(p_72367_1_); - FMLCommonHandler.instance().firePlayerLoggedOut(p_72367_1_);
+ disconnect(p_72367_1_); + disconnect(p_72367_1_);
+ } + }
+ // Cauldron end
+ +
+ // Cauldron end
+ public String disconnect(EntityPlayerMP p_72367_1_) // CraftBukkit - return string + public String disconnect(EntityPlayerMP p_72367_1_) // CraftBukkit - return string
+ { + {
p_72367_1_.triggerAchievement(StatList.leaveGameStat); p_72367_1_.triggerAchievement(StatList.leaveGameStat);
@ -255,7 +253,7 @@
{ {
worldserver.removePlayerEntityDangerously(p_72367_1_.ridingEntity); worldserver.removePlayerEntityDangerously(p_72367_1_.ridingEntity);
logger.debug("removing player mount"); logger.debug("removing player mount");
@@ -329,9 +448,35 @@ @@ -329,9 +446,35 @@
worldserver.removeEntity(p_72367_1_); worldserver.removeEntity(p_72367_1_);
worldserver.getPlayerManager().removePlayer(p_72367_1_); worldserver.getPlayerManager().removePlayer(p_72367_1_);
this.playerEntityList.remove(p_72367_1_); this.playerEntityList.remove(p_72367_1_);
@ -294,7 +292,7 @@
} }
public String allowUserToConnect(SocketAddress p_148542_1_, GameProfile p_148542_2_) public String allowUserToConnect(SocketAddress p_148542_1_, GameProfile p_148542_2_)
@@ -372,6 +517,71 @@ @@ -372,6 +515,71 @@
} }
} }
@ -366,7 +364,7 @@
public EntityPlayerMP createPlayerForUser(GameProfile p_148545_1_) public EntityPlayerMP createPlayerForUser(GameProfile p_148545_1_)
{ {
UUID uuid = EntityPlayer.func_146094_a(p_148545_1_); UUID uuid = EntityPlayer.func_146094_a(p_148545_1_);
@@ -410,80 +620,200 @@ @@ -410,80 +618,199 @@
return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), p_148545_1_, (ItemInWorldManager)object); return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), p_148545_1_, (ItemInWorldManager)object);
} }
@ -428,7 +426,7 @@
- WorldServer worldserver = this.mcServer.worldServerForDimension(p_72368_1_.dimension); - WorldServer worldserver = this.mcServer.worldServerForDimension(p_72368_1_.dimension);
- this.func_72381_a(entityplayermp1, p_72368_1_, worldserver); - this.func_72381_a(entityplayermp1, p_72368_1_, worldserver);
+ return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), p_148545_1_, (ItemInWorldManager)object); + return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), p_148545_1_, (ItemInWorldManager)object);
+ // */ + // */
+ return player; + return player;
+ // CraftBukkit end + // CraftBukkit end
+ } + }
@ -436,7 +434,7 @@
+ // Cauldron start - refactor entire method for sanity. + // Cauldron start - refactor entire method for sanity.
+ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3) + public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3)
+ { + {
+ return this.respawnPlayer(par1EntityPlayerMP, par2, par3, null); + return this.respawnPlayer(par1EntityPlayerMP, par2, par3, null);
+ } + }
+ +
+ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int targetDimension, boolean returnFromEnd, Location location) + public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int targetDimension, boolean returnFromEnd, Location location)
@ -530,7 +528,6 @@
+ location = new Location(toWorld, toWorld.getSpawnLocation().getX(), toWorld.getSpawnLocation().getY(), toWorld.getSpawnLocation().getZ()); // use the world spawnpoint as default location + location = new Location(toWorld, toWorld.getSpawnLocation().getX(), toWorld.getSpawnLocation().getY(), toWorld.getSpawnLocation().getZ()); // use the world spawnpoint as default location
} }
- else - else
+
+ Player respawnPlayer = this.cserver.getPlayer(entityplayermp1); + Player respawnPlayer = this.cserver.getPlayer(entityplayermp1);
+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn); + PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn);
+ this.cserver.getPluginManager().callEvent(respawnEvent); + this.cserver.getPluginManager().callEvent(respawnEvent);
@ -607,7 +604,7 @@
return entityplayermp1; return entityplayermp1;
} }
@@ -492,34 +822,110 @@ @@ -492,34 +819,112 @@
transferPlayerToDimension(p_72356_1_, p_72356_2_, mcServer.worldServerForDimension(p_72356_2_).getDefaultTeleporter()); transferPlayerToDimension(p_72356_1_, p_72356_2_, mcServer.worldServerForDimension(p_72356_2_).getDefaultTeleporter());
} }
@ -718,11 +715,13 @@
+ +
while (iterator.hasNext()) while (iterator.hasNext())
{ {
PotionEffect potioneffect = (PotionEffect)iterator.next(); - PotionEffect potioneffect = (PotionEffect)iterator.next();
- p_72356_1_.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(p_72356_1_.getEntityId(), potioneffect)); - p_72356_1_.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(p_72356_1_.getEntityId(), potioneffect));
+ PotionEffect potioneffect = (PotionEffect) iterator.next();
+ par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(par1EntityPlayerMP.getEntityId(), potioneffect)); + par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(par1EntityPlayerMP.getEntityId(), potioneffect));
} }
- FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_72356_1_, j, p_72356_2_); - FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_72356_1_, j, p_72356_2_);
+
+ FMLCommonHandler.instance().firePlayerChangedDimensionEvent(par1EntityPlayerMP, fromWorld.dimension, targetDimension); + FMLCommonHandler.instance().firePlayerChangedDimensionEvent(par1EntityPlayerMP, fromWorld.dimension, targetDimension);
} }
@ -733,10 +732,11 @@
+ // transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.getDefaultTeleporter()); + // transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.getDefaultTeleporter());
+ Location exit = this.calculateTarget(p_82448_1_.getBukkitEntity().getLocation(), p_82448_4_); + Location exit = this.calculateTarget(p_82448_1_.getBukkitEntity().getLocation(), p_82448_4_);
+ this.repositionEntity(p_82448_1_, exit, true); + this.repositionEntity(p_82448_1_, exit, true);
+ // CraftBukkit end
} }
public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, Teleporter teleporter) public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, Teleporter teleporter)
@@ -605,6 +1011,109 @@ @@ -605,6 +1010,109 @@
p_82448_1_.setWorld(p_82448_4_); p_82448_1_.setWorld(p_82448_4_);
} }
@ -751,17 +751,16 @@
+ float pitch = enter.getPitch(); + float pitch = enter.getPitch();
+ double d0 = enter.getX(); + double d0 = enter.getX();
+ double d1 = enter.getZ(); + double d1 = enter.getZ();
+ double d2 = 8.0D;
+ +
+ if (worldserver1.dimension == -1) + if (worldserver1.dimension == -1)
+ { + {
+ d0 /= d2; + d0 /= 8.0D;
+ d1 /= d2; + d1 /= 8.0D;
+ } + }
+ else if (worldserver1.dimension == 0) + else if (worldserver1.dimension == 0)
+ { + {
+ d0 *= d2; + d0 *= 8.0D;
+ d1 *= d2; + d1 *= 8.0D;
+ } + }
+ else + else
+ { + {
@ -787,6 +786,7 @@
+ yaw = 90.0F; + yaw = 90.0F;
+ pitch = 0.0F; + pitch = 0.0F;
+ } + }
+ // Cauldron end
+ } + }
+ +
+ if (i != 1) + if (i != 1)
@ -846,7 +846,7 @@
public void sendPlayerInfoToAllPlayers() public void sendPlayerInfoToAllPlayers()
{ {
if (++this.playerPingIndex > 600) if (++this.playerPingIndex > 600)
@@ -612,11 +1121,13 @@ @@ -612,11 +1120,13 @@
this.playerPingIndex = 0; this.playerPingIndex = 0;
} }
@ -860,7 +860,7 @@
} }
public void sendPacketToAllPlayers(Packet p_148540_1_) public void sendPacketToAllPlayers(Packet p_148540_1_)
@@ -877,13 +1388,24 @@ @@ -877,13 +1387,24 @@
for (int j = 0; j < this.playerEntityList.size(); ++j) for (int j = 0; j < this.playerEntityList.size(); ++j)
{ {
EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(j); EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(j);
@ -887,7 +887,7 @@
if (d4 * d4 + d5 * d5 + d6 * d6 < p_148543_8_ * p_148543_8_) if (d4 * d4 + d5 * d5 + d6 * d6 < p_148543_8_ * p_148543_8_)
{ {
entityplayermp.playerNetServerHandler.sendPacket(p_148543_11_); entityplayermp.playerNetServerHandler.sendPacket(p_148543_11_);
@@ -941,13 +1463,16 @@ @@ -941,13 +1462,16 @@
p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F));
p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, p_72354_2_.getRainStrength(1.0F))); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, p_72354_2_.getRainStrength(1.0F)));
p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, p_72354_2_.getWeightedThunderStrength(1.0F))); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, p_72354_2_.getWeightedThunderStrength(1.0F)));
@ -905,7 +905,7 @@
p_72385_1_.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(p_72385_1_.inventory.currentItem)); p_72385_1_.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(p_72385_1_.inventory.currentItem));
} }
@@ -963,7 +1488,10 @@ @@ -963,7 +1487,10 @@
public String[] getAvailablePlayerDat() public String[] getAvailablePlayerDat()
{ {
@ -917,7 +917,7 @@
} }
public void setWhiteListEnabled(boolean p_72371_1_) public void setWhiteListEnabled(boolean p_72371_1_)
@@ -1032,12 +1560,30 @@ @@ -1032,12 +1559,30 @@
public void removeAllPlayers() public void removeAllPlayers()
{ {

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/util/ChunkCoordinates.java
+++ ../src-work/minecraft/net/minecraft/util/ChunkCoordinates.java
@@ -38,7 +38,7 @@
public int hashCode()
{
- return this.posX + this.posZ << 8 + this.posY << 16;
+ return this.posX + (this.posZ << 8) + (this.posY << 16);
}
public int compareTo(ChunkCoordinates p_compareTo_1_)

View File

@ -62,7 +62,7 @@
public abstract class World implements IBlockAccess public abstract class World implements IBlockAccess
{ {
/** /**
@@ -83,10 +128,10 @@ @@ -83,15 +128,14 @@
public boolean scheduledUpdatesAreImmediate; public boolean scheduledUpdatesAreImmediate;
public List loadedEntityList = new ArrayList(); public List loadedEntityList = new ArrayList();
@ -75,11 +75,17 @@
public List playerEntities = new ArrayList(); public List playerEntities = new ArrayList();
public List weatherEffects = new ArrayList(); public List weatherEffects = new ArrayList();
private long cloudColour = 16777215L; private long cloudColour = 16777215L;
@@ -100,26 +145,87 @@ public int skylightSubtracted;
- protected int updateLCG = (new Random()).nextInt();
protected final int DIST_HASH_MAGIC = 1013904223;
public float prevRainingStrength;
public float rainingStrength;
@@ -100,26 +144,88 @@
public int lastLightningBolt; public int lastLightningBolt;
public EnumDifficulty difficultySetting; public EnumDifficulty difficultySetting;
public Random rand = new Random(); public Random rand = new Random();
- public final WorldProvider provider; - public final WorldProvider provider;
+ protected int updateLCG = this.rand.nextInt();
+ public WorldProvider provider; // CraftBukkit - remove final + public WorldProvider provider; // CraftBukkit - remove final
protected List worldAccesses = new ArrayList(); protected List worldAccesses = new ArrayList();
- protected IChunkProvider chunkProvider; - protected IChunkProvider chunkProvider;

View File

@ -204,6 +204,15 @@
this.worldObj.unloadEntities(this.entityLists[i]); this.worldObj.unloadEntities(this.entityLists[i]);
} }
MinecraftForge.EVENT_BUS.post(new ChunkEvent.Unload(this)); MinecraftForge.EVENT_BUS.post(new ChunkEvent.Unload(this));
@@ -1025,7 +1139,7 @@
public Random getRandomWithSeed(long p_76617_1_)
{
- return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ p_76617_1_);
+ return new Random(this.worldObj.getSeed() + (4987142L * this.xPosition * this.xPosition) + (5947611L * this.xPosition) + (4392871L * this.zPosition * this.zPosition) + (389711L * this.zPosition) ^ p_76617_1_);
}
public boolean isEmpty()
@@ -1035,6 +1149,7 @@ @@ -1035,6 +1149,7 @@
public void populateChunk(IChunkProvider p_76624_1_, IChunkProvider p_76624_2_, int p_76624_3_, int p_76624_4_) public void populateChunk(IChunkProvider p_76624_1_, IChunkProvider p_76624_2_, int p_76624_3_, int p_76624_4_)

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/world/chunk/EmptyChunk.java
+++ ../src-work/minecraft/net/minecraft/world/chunk/EmptyChunk.java
@@ -113,7 +113,7 @@
public Random getRandomWithSeed(long p_76617_1_)
{
- return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ p_76617_1_);
+ return new Random(this.worldObj.getSeed() + (4987142L * this.xPosition * this.xPosition) + (5947611L * this.xPosition) + (4392871L * this.zPosition * this.zPosition) + (389711L * this.zPosition) ^ p_76617_1_);
}
public boolean isEmpty()

View File

@ -0,0 +1,10 @@
--- ../src-base/minecraft/net/minecraft/world/gen/FlatLayerInfo.java
+++ ../src-work/minecraft/net/minecraft/world/gen/FlatLayerInfo.java
@@ -12,7 +12,6 @@
public FlatLayerInfo(int p_i45467_1_, Block p_i45467_2_)
{
- this.layerCount = 1;
this.layerCount = p_i45467_1_;
this.field_151537_a = p_i45467_2_;
}

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java
@@ -50,7 +50,7 @@
p_76484_1_.setBlock(i1, j1, k1, Blocks.chest, 0, 2);
TileEntityChest tileentitychest = (TileEntityChest)p_76484_1_.getTileEntity(i1, j1, k1);
- if (tileentitychest != null && tileentitychest != null)
+ if (tileentitychest != null)
{
WeightedRandomChestContent.generateChestContents(p_76484_2_, this.theBonusChestGenerator, tileentitychest, this.itemsToGenerateInBonusChest);
}

View File

@ -124,7 +124,7 @@
public IPlayerFileData getSaveHandler() public IPlayerFileData getSaveHandler()
{ {
return this; return this;
@@ -323,6 +371,99 @@ @@ -323,6 +371,100 @@
return this.saveDirectoryName; return this.saveDirectoryName;
} }
@ -202,6 +202,7 @@
+ { + {
+ return playersDirectory; + return playersDirectory;
+ } + }
+
+ // CraftBukkit end + // CraftBukkit end
+ +
+ // Cauldron start + // Cauldron start

View File

@ -5,7 +5,7 @@
public static final int revisionVersion = 3; public static final int revisionVersion = 3;
//This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code. //This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code.
- public static final int buildVersion = 0; - public static final int buildVersion = 0;
+ public static final int buildVersion = 1370; // Cauldron + public static final int buildVersion = 1388; // Cauldron
private static Status status = PENDING; private static Status status = PENDING;
private static String target = null; private static String target = null;

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraftforge/common/chunkio/ChunkIOExecutor.java
+++ ../src-work/minecraft/net/minecraftforge/common/chunkio/ChunkIOExecutor.java
@@ -22,7 +22,7 @@
}
public static void adjustPoolSize(int players) {
- int size = Math.max(BASE_THREADS, (int) Math.ceil(players / PLAYERS_PER_THREAD));
+ int size = Math.max(BASE_THREADS, (int) Math.ceil((double) players / PLAYERS_PER_THREAD));
instance.setActiveThreads(size);
}

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/org/bukkit/command/defaults/BanIpCommand.java
+++ ../src-work/minecraft/org/bukkit/command/defaults/BanIpCommand.java
@@ -32,7 +32,7 @@
return false;
}
- String reason = args.length > 0 ? StringUtils.join(args, ' ', 1, args.length) : null;
+ String reason = StringUtils.join(args, ' ', 1, args.length);
if (ipValidity.matcher(args[0]).matches()) {
processIPBan(args[0], sender, reason);

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/org/bukkit/command/defaults/SpreadPlayersCommand.java
+++ ../src-work/minecraft/org/bukkit/command/defaults/SpreadPlayersCommand.java
@@ -92,7 +92,7 @@
final int rangeSpread = range(world, distance, xRangeMin, zRangeMin, xRangeMax, zRangeMax, locations);
if (rangeSpread == -1) {
- sender.sendMessage(String.format("Could not spread %d %s around %s,%s (too many players for space - try using spread of at most %s)", spreadSize, teams ? "teams" : "players", x, z));
+ sender.sendMessage(String.format("Could not spread %d %s around %s,%s (too many players for space - try using spread of at most %s)", spreadSize, teams ? "teams" : "players", x, z, "TODO")); // TODO: Add latest argument
return false;
}

View File

@ -0,0 +1,36 @@
--- ../src-base/minecraft/org/bukkit/configuration/MemorySection.java
+++ ../src-work/minecraft/org/bukkit/configuration/MemorySection.java
@@ -760,7 +760,8 @@
* @return Full path of the section from its root.
*/
public static String createPath(ConfigurationSection section, String key) {
- return createPath(section, key, (section == null) ? null : section.getRoot());
+ Validate.notNull(section, "Cannot create path without a section");
+ return createPath(section, key, section.getRoot());
}
/**
@@ -784,17 +785,15 @@
char separator = root.options().pathSeparator();
StringBuilder builder = new StringBuilder();
- if (section != null) {
- for (ConfigurationSection parent = section; (parent != null) && (parent != relativeTo); parent = parent.getParent()) {
- if (builder.length() > 0) {
- builder.insert(0, separator);
- }
-
- builder.insert(0, parent.getName());
+ for (ConfigurationSection parent = section; parent != null && parent != relativeTo; parent = parent.getParent()) {
+ if (builder.length() > 0) {
+ builder.insert(0, separator);
}
+
+ builder.insert(0, parent.getName());
}
- if ((key != null) && (key.length() > 0)) {
+ if (key != null && key.length() > 0) {
if (builder.length() > 0) {
builder.append(separator);
}

View File

@ -247,11 +247,11 @@ public class CraftInventory implements Inventory {
} }
private int firstPartial(ItemStack item) { private int firstPartial(ItemStack item) {
ItemStack[] inventory = getContents();
ItemStack filteredItem = CraftItemStack.asCraftCopy(item);
if (item == null) { if (item == null) {
return -1; return -1;
} }
ItemStack[] inventory = getContents();
ItemStack filteredItem = CraftItemStack.asCraftCopy(item);
for (int i = 0; i < inventory.length; i++) { for (int i = 0; i < inventory.length; i++) {
ItemStack cItem = inventory[i]; ItemStack cItem = inventory[i];
if (cItem != null && cItem.getAmount() < cItem.getMaxStackSize() && cItem.isSimilar(filteredItem)) { if (cItem != null && cItem.getAmount() < cItem.getMaxStackSize() && cItem.isSimilar(filteredItem)) {

View File

@ -103,7 +103,7 @@ public class CustomTimingsHandler
{ {
if ( timings.curTickTotal > 50000000 ) if ( timings.curTickTotal > 50000000 )
{ {
timings.violations += Math.ceil( timings.curTickTotal / 50000000 ); timings.violations += Math.ceil( (double) timings.curTickTotal / 50000000 );
} }
timings.curTickTotal = 0; timings.curTickTotal = 0;
timings.timingDepth = 0; // incase reset messes this up timings.timingDepth = 0; // incase reset messes this up