forked from xjboss/KCauldronX
Normalize patches
This commit is contained in:
parent
86f83acb7e
commit
c427f60e15
@ -15,14 +15,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ if (!"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
|
+ if (!"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
|
||||||
+ java.util.Iterator<ModContainer> iterator = modList.iterator();
|
+ java.util.Iterator<ModContainer> iterator = modList.iterator();
|
||||||
+ while(iterator.hasNext()) {
|
+ while(iterator.hasNext()) {
|
||||||
+ ModContainer container = iterator.next();
|
+ ModContainer container = iterator.next();
|
||||||
+ if ("FastCraft".equals(container.getModId())) {
|
+ if ("FastCraft".equals(container.getModId())) {
|
||||||
+ FMLLog.log(Level.WARN, "Found FastCraft mod, removing it...");
|
+ FMLLog.log(Level.WARN, "Found FastCraft mod, removing it...");
|
||||||
+ iterator.remove();
|
+ iterator.remove();
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
return modList;
|
return modList;
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
+ io.netty.util.Attribute<NetworkDispatcher> attr = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER);
|
+ io.netty.util.Attribute<NetworkDispatcher> attr = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER);
|
||||||
+ if (attr != null)
|
+ if (attr != null)
|
||||||
+ {
|
+ {
|
||||||
+ NetworkDispatcher dispatcher = attr.getAndRemove();
|
+ NetworkDispatcher dispatcher = attr.getAndRemove();
|
||||||
+ if (dispatcher != null) dispatcher.completeHandshake(msg.target);
|
+ if (dispatcher != null) dispatcher.completeHandshake(msg.target);
|
||||||
+ }
|
+ }
|
||||||
+ // Cauldron end
|
+ // Cauldron end
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public void injectIntoClassLoader(LaunchClassLoader classLoader)
|
public void injectIntoClassLoader(LaunchClassLoader classLoader)
|
||||||
{
|
{
|
||||||
+ // Cauldron end
|
+ // Cauldron end
|
||||||
FMLRelaunchLog.fine("Injecting coremod %s {%s} class transformers", name, coreModInstance.getClass().getName());
|
FMLRelaunchLog.fine("Injecting coremod %s {%s} class transformers", name, coreModInstance.getClass().getName());
|
||||||
if (coreModInstance.getASMTransformerClass() != null) for (String transformer : coreModInstance.getASMTransformerClass())
|
if (coreModInstance.getASMTransformerClass() != null) for (String transformer : coreModInstance.getASMTransformerClass())
|
||||||
{
|
{
|
||||||
@ -74,10 +74,10 @@
|
|||||||
String cascadedTweaker = mfAttributes.getValue("TweakClass");
|
String cascadedTweaker = mfAttributes.getValue("TweakClass");
|
||||||
if (cascadedTweaker != null)
|
if (cascadedTweaker != null)
|
||||||
{
|
{
|
||||||
+ if ("fastcraft.Tweaker".equals(cascadedTweaker) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
|
+ if ("fastcraft.Tweaker".equals(cascadedTweaker) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
|
||||||
+ FMLRelaunchLog.info("Found FastCraft tweaker, skipping...");
|
+ FMLRelaunchLog.info("Found FastCraft tweaker, skipping...");
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
FMLRelaunchLog.info("Loading tweaker %s from %s", cascadedTweaker, coreMod.getName());
|
FMLRelaunchLog.info("Loading tweaker %s from %s", cascadedTweaker, coreMod.getName());
|
||||||
Integer sortOrder = Ints.tryParse(Strings.nullToEmpty(mfAttributes.getValue("TweakOrder")));
|
Integer sortOrder = Ints.tryParse(Strings.nullToEmpty(mfAttributes.getValue("TweakOrder")));
|
||||||
sortOrder = (sortOrder == null ? Integer.valueOf(0) : sortOrder);
|
sortOrder = (sortOrder == null ? Integer.valueOf(0) : sortOrder);
|
||||||
@ -87,7 +87,7 @@
|
|||||||
}
|
}
|
||||||
+ if ("fastcraft.LoadingPlugin".equals(fmlCorePlugin) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
|
+ if ("fastcraft.LoadingPlugin".equals(fmlCorePlugin) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
|
||||||
+ FMLRelaunchLog.warning("Found FastCraft coremod, skipping...");
|
+ FMLRelaunchLog.warning("Found FastCraft coremod, skipping...");
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
// Support things that are mod jars, but not FML mod jars
|
// Support things that are mod jars, but not FML mod jars
|
||||||
try
|
try
|
||||||
|
@ -787,7 +787,7 @@
|
|||||||
+
|
+
|
||||||
+ // Cauldron start
|
+ // Cauldron start
|
||||||
+ public boolean entityAllowedToSpawn() {
|
+ public boolean entityAllowedToSpawn() {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+ // Cauldron end
|
+ // Cauldron end
|
||||||
}
|
}
|
||||||
|
@ -532,10 +532,10 @@
|
|||||||
+ {
|
+ {
|
||||||
+ float armorDamage = (float) (event.getDamage() + event.getDamage(DamageModifier.BLOCKING) + event.getDamage(DamageModifier.HARD_HAT));
|
+ float armorDamage = (float) (event.getDamage() + event.getDamage(DamageModifier.BLOCKING) + event.getDamage(DamageModifier.HARD_HAT));
|
||||||
+ if (this instanceof EntityPlayer) {
|
+ if (this instanceof EntityPlayer) {
|
||||||
+ EntityPlayer player = (EntityPlayer) this;
|
+ EntityPlayer player = (EntityPlayer) this;
|
||||||
+ armorDamage = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, damagesource, armorDamage, true);
|
+ armorDamage = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, damagesource, armorDamage, true);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ this.damageArmor(armorDamage);
|
+ this.damageArmor(armorDamage);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -41,8 +41,8 @@
|
|||||||
{
|
{
|
||||||
ItemStack stack = this.getDataWatcher().getWatchableObjectItemStack(10);
|
ItemStack stack = this.getDataWatcher().getWatchableObjectItemStack(10);
|
||||||
+ if (stack == null || stack.stackSize == 0) {
|
+ if (stack == null || stack.stackSize == 0) {
|
||||||
+ setDead();
|
+ setDead();
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
if (stack != null && stack.getItem() != null)
|
if (stack != null && stack.getItem() != null)
|
||||||
{
|
{
|
||||||
@ -306,7 +306,7 @@
|
|||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean entityAllowedToSpawn() {
|
+ public boolean entityAllowedToSpawn() {
|
||||||
+ ItemStack stack = getDataWatcher().getWatchableObjectItemStack(10);
|
+ ItemStack stack = getDataWatcher().getWatchableObjectItemStack(10);
|
||||||
+ return stack != null && stack.getItem() != null && stack.stackSize > 0;
|
+ return stack != null && stack.getItem() != null && stack.stackSize > 0;
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@
|
|||||||
+
|
+
|
||||||
+ // Spigot start
|
+ // Spigot start
|
||||||
+ public boolean areItemStacksEqual(ItemStack is1, ItemStack is2) {
|
+ public boolean areItemStacksEqual(ItemStack is1, ItemStack is2) {
|
||||||
+ return tickCount % fullMatchRate == 0 ? ItemStack.areItemStacksEqual(is1, is2) : ItemStack.fastMatches(is1, is2);
|
+ return tickCount % fullMatchRate == 0 ? ItemStack.areItemStacksEqual(is1, is2) : ItemStack.fastMatches(is1, is2);
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot
|
+ // Spigot
|
||||||
}
|
}
|
||||||
|
@ -155,9 +155,9 @@
|
|||||||
+
|
+
|
||||||
+ // Spigot start
|
+ // Spigot start
|
||||||
+ public static boolean fastMatches(ItemStack is1, ItemStack is2) {
|
+ public static boolean fastMatches(ItemStack is1, ItemStack is2) {
|
||||||
+ if (is1 == null && is2 == null) return true;
|
+ if (is1 == null && is2 == null) return true;
|
||||||
+ if (is1 != null && is2 != null) return is1.stackSize == is2.stackSize && is1.field_151002_e == is2.field_151002_e && is1.itemDamage == is2.itemDamage;
|
+ if (is1 != null && is2 != null) return is1.stackSize == is2.stackSize && is1.field_151002_e == is2.field_151002_e && is1.itemDamage == is2.itemDamage;
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
- try
|
- try
|
||||||
- {
|
- {
|
||||||
- if (!this.running)
|
- if (!this.running)
|
||||||
+ while (true)
|
+ while (true)
|
||||||
+ {
|
+ {
|
||||||
+ if (!this.running || clientSocket == null)
|
+ if (!this.running || clientSocket == null)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@ -24,7 +24,7 @@
|
|||||||
+
|
+
|
||||||
+ if (i < 10)
|
+ if (i < 10)
|
||||||
{
|
{
|
||||||
+ this.running = false; // Cauldron
|
+ this.running = false; // Cauldron
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
catch (SocketTimeoutException sockettimeoutexception)
|
catch (SocketTimeoutException sockettimeoutexception)
|
||||||
{
|
{
|
||||||
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
private void closeSocket()
|
private void closeSocket()
|
||||||
{
|
{
|
||||||
+ this.running = false;
|
+ this.running = false;
|
||||||
if (null != this.clientSocket)
|
if (null != this.clientSocket)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -912,8 +912,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ public int getMaxVisiblePlayers() {
|
+ public int getMaxVisiblePlayers() {
|
||||||
+ int max = mcServer.cauldronConfig.maxPlayersVisible.getValue();
|
+ int max = mcServer.cauldronConfig.maxPlayersVisible.getValue();
|
||||||
+ return max > 0 ? max : maxPlayers;
|
+ return max > 0 ? max : maxPlayers;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
public String[] getAvailablePlayerDat()
|
public String[] getAvailablePlayerDat()
|
||||||
|
@ -143,22 +143,22 @@
|
|||||||
public void processLoginStart(C00PacketLoginStart p_147316_1_)
|
public void processLoginStart(C00PacketLoginStart p_147316_1_)
|
||||||
{
|
{
|
||||||
- Validate.validState(this.field_147328_g == NetHandlerLoginServer.LoginState.HELLO, "Unexpected hello packet", new Object[0]);
|
- Validate.validState(this.field_147328_g == NetHandlerLoginServer.LoginState.HELLO, "Unexpected hello packet", new Object[0]);
|
||||||
+ if (debug) logger.info("Login attempt");
|
+ if (debug) logger.info("Login attempt");
|
||||||
+ Validate.validState(this.field_147328_g == LoginState.HELLO, "Unexpected hello packet", new Object[0]);
|
+ Validate.validState(this.field_147328_g == LoginState.HELLO, "Unexpected hello packet", new Object[0]);
|
||||||
this.field_147337_i = p_147316_1_.func_149304_c();
|
this.field_147337_i = p_147316_1_.func_149304_c();
|
||||||
+ if (debug) logger.info("Received profile: " + this.field_147337_i.getName());
|
+ if (debug) logger.info("Received profile: " + this.field_147337_i.getName());
|
||||||
|
|
||||||
if (this.field_147327_f.isServerInOnlineMode() && !this.field_147333_a.isLocalChannel())
|
if (this.field_147327_f.isServerInOnlineMode() && !this.field_147333_a.isLocalChannel())
|
||||||
{
|
{
|
||||||
- this.field_147328_g = NetHandlerLoginServer.LoginState.KEY;
|
- this.field_147328_g = NetHandlerLoginServer.LoginState.KEY;
|
||||||
+ if (debug) logger.info("Send encryption request to " + this.field_147337_i.getName());
|
+ if (debug) logger.info("Send encryption request to " + this.field_147337_i.getName());
|
||||||
+ this.field_147328_g = LoginState.KEY;
|
+ this.field_147328_g = LoginState.KEY;
|
||||||
this.field_147333_a.scheduleOutboundPacket(new S01PacketEncryptionRequest(this.field_147334_j, this.field_147327_f.getKeyPair().getPublic(), this.field_147330_e), new GenericFutureListener[0]);
|
this.field_147333_a.scheduleOutboundPacket(new S01PacketEncryptionRequest(this.field_147334_j, this.field_147327_f.getKeyPair().getPublic(), this.field_147330_e), new GenericFutureListener[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
- this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT;
|
- this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT;
|
||||||
+ if (debug) logger.info("Lookup offline UUID for " + this.field_147337_i.getName());
|
+ if (debug) logger.info("Lookup offline UUID for " + this.field_147337_i.getName());
|
||||||
+ (new ThreadPlayerLookupUUID(this, "User Authenticator #" + field_147331_b.incrementAndGet())).start(); // Spigot
|
+ (new ThreadPlayerLookupUUID(this, "User Authenticator #" + field_147331_b.incrementAndGet())).start(); // Spigot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
+ if (debug) logger.info("Enabling encryption for " + this.field_147337_i.getName());
|
+ if (debug) logger.info("Enabling encryption for " + this.field_147337_i.getName());
|
||||||
this.field_147335_k = p_147315_1_.func_149300_a(privatekey);
|
this.field_147335_k = p_147315_1_.func_149300_a(privatekey);
|
||||||
this.field_147328_g = NetHandlerLoginServer.LoginState.AUTHENTICATING;
|
this.field_147328_g = NetHandlerLoginServer.LoginState.AUTHENTICATING;
|
||||||
this.field_147333_a.enableEncryption(this.field_147335_k);
|
this.field_147333_a.enableEncryption(this.field_147335_k);
|
||||||
@ -223,7 +223,7 @@
|
|||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
- }).start();
|
- }).start();
|
||||||
+ if (debug) logger.info("Lookup online UUID for " + this.field_147337_i.getName());
|
+ if (debug) logger.info("Lookup online UUID for " + this.field_147337_i.getName());
|
||||||
+ (new ThreadPlayerLookupUUID(this, "User Authenticator #" + field_147331_b.incrementAndGet())).start();
|
+ (new ThreadPlayerLookupUUID(this, "User Authenticator #" + field_147331_b.incrementAndGet())).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -246,7 +246,7 @@
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ static GameProfile processPlayerLoginGameProfile(NetHandlerLoginServer loginServer, GameProfile gameprofile) {
|
+ static GameProfile processPlayerLoginGameProfile(NetHandlerLoginServer loginServer, GameProfile gameprofile) {
|
||||||
+ if (loginServer.debug) logger.info("Player logged in: " + gameprofile);
|
+ if (loginServer.debug) logger.info("Player logged in: " + gameprofile);
|
||||||
+ return loginServer.field_147337_i = gameprofile;
|
+ return loginServer.field_147337_i = gameprofile;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -256,7 +256,7 @@
|
|||||||
+ org.bukkit.World.Environment env)
|
+ org.bukkit.World.Environment env)
|
||||||
+ {
|
+ {
|
||||||
+ this.spigotConfig = new org.spigotmc.SpigotWorldConfig(p_i45369_2_); // Spigot
|
+ this.spigotConfig = new org.spigotmc.SpigotWorldConfig(p_i45369_2_); // Spigot
|
||||||
+ initLimiter(); // Spigot
|
+ initLimiter(); // Spigot
|
||||||
+ // Cauldron start
|
+ // Cauldron start
|
||||||
+ this.cauldronConfig = new CauldronWorldConfig(p_i45369_2_, MinecraftServer.getServer().cauldronConfig);
|
+ this.cauldronConfig = new CauldronWorldConfig(p_i45369_2_, MinecraftServer.getServer().cauldronConfig);
|
||||||
+ this.tileentityConfig = new TileEntityWorldConfig(p_i45369_2_, MinecraftServer.getServer().tileEntityConfig);
|
+ this.tileentityConfig = new TileEntityWorldConfig(p_i45369_2_, MinecraftServer.getServer().tileEntityConfig);
|
||||||
@ -401,7 +401,7 @@
|
|||||||
+ if (DimensionManager.getWorld(0) != null)
|
+ if (DimensionManager.getWorld(0) != null)
|
||||||
+ {
|
+ {
|
||||||
+ this.spigotConfig = new org.spigotmc.SpigotWorldConfig(p_i45369_2_); // Spigot
|
+ this.spigotConfig = new org.spigotmc.SpigotWorldConfig(p_i45369_2_); // Spigot
|
||||||
+ initLimiter(); // Spigot
|
+ initLimiter(); // Spigot
|
||||||
+ this.cauldronConfig = new CauldronWorldConfig(p_i45369_2_, MinecraftServer.getServer().cauldronConfig);
|
+ this.cauldronConfig = new CauldronWorldConfig(p_i45369_2_, MinecraftServer.getServer().cauldronConfig);
|
||||||
+ this.tileentityConfig = new TileEntityWorldConfig(p_i45369_2_, MinecraftServer.getServer().tileEntityConfig);
|
+ this.tileentityConfig = new TileEntityWorldConfig(p_i45369_2_, MinecraftServer.getServer().tileEntityConfig);
|
||||||
+ this.world = DimensionManager.getWorld(0).getWorld();
|
+ this.world = DimensionManager.getWorld(0).getWorld();
|
||||||
@ -627,7 +627,7 @@
|
|||||||
+
|
+
|
||||||
+ public boolean addEntity(Entity p_72838_1_, SpawnReason spawnReason) // Changed signature, added SpawnReason
|
+ public boolean addEntity(Entity p_72838_1_, SpawnReason spawnReason) // Changed signature, added SpawnReason
|
||||||
+ {
|
+ {
|
||||||
+ if (!p_72838_1_.entityAllowedToSpawn()) return false; // Cauldron
|
+ if (!p_72838_1_.entityAllowedToSpawn()) return false; // Cauldron
|
||||||
// do not drop any items while restoring blocksnapshots. Prevents dupes
|
// do not drop any items while restoring blocksnapshots. Prevents dupes
|
||||||
if (!this.isRemote && (p_72838_1_ == null || (p_72838_1_ instanceof net.minecraft.entity.item.EntityItem && this.restoringBlockSnapshots))) return false;
|
if (!this.isRemote && (p_72838_1_ == null || (p_72838_1_ instanceof net.minecraft.entity.item.EntityItem && this.restoringBlockSnapshots))) return false;
|
||||||
|
|
||||||
@ -875,7 +875,7 @@
|
|||||||
+ int entitiesThisCycle = 0;
|
+ int entitiesThisCycle = 0;
|
||||||
+ if (tickPosition < 0) tickPosition = 0;
|
+ if (tickPosition < 0) tickPosition = 0;
|
||||||
+ for (entityLimiter.initTick(); entitiesThisCycle < loadedEntityList.size() && (entitiesThisCycle % 10 == 0 || entityLimiter.shouldContinue()); tickPosition++, entitiesThisCycle++) {
|
+ for (entityLimiter.initTick(); entitiesThisCycle < loadedEntityList.size() && (entitiesThisCycle % 10 == 0 || entityLimiter.shouldContinue()); tickPosition++, entitiesThisCycle++) {
|
||||||
+ tickPosition = (tickPosition < loadedEntityList.size()) ? tickPosition : 0;
|
+ tickPosition = (tickPosition < loadedEntityList.size()) ? tickPosition : 0;
|
||||||
+ entity = (Entity)this.loadedEntityList.get(this.tickPosition);
|
+ entity = (Entity)this.loadedEntityList.get(this.tickPosition);
|
||||||
|
|
||||||
if (entity.ridingEntity != null)
|
if (entity.ridingEntity != null)
|
||||||
@ -925,8 +925,8 @@
|
|||||||
- if (!tileentity.isInvalid() && tileentity.hasWorldObj() && this.blockExists(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord))
|
- if (!tileentity.isInvalid() && tileentity.hasWorldObj() && this.blockExists(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord))
|
||||||
+ int tilesThisCycle = 0;
|
+ int tilesThisCycle = 0;
|
||||||
+ for (tileLimiter.initTick(); tilesThisCycle < loadedTileEntityList.size() && (tilesThisCycle % 10 == 0 || tileLimiter.shouldContinue()); tileTickPosition++, tilesThisCycle++) {
|
+ for (tileLimiter.initTick(); tilesThisCycle < loadedTileEntityList.size() && (tilesThisCycle % 10 == 0 || tileLimiter.shouldContinue()); tileTickPosition++, tilesThisCycle++) {
|
||||||
+ tileTickPosition = (tileTickPosition < loadedTileEntityList.size()) ? tileTickPosition : 0;
|
+ tileTickPosition = (tileTickPosition < loadedTileEntityList.size()) ? tileTickPosition : 0;
|
||||||
+ TileEntity tileentity = (TileEntity) this.loadedTileEntityList.get(tileTickPosition);
|
+ TileEntity tileentity = (TileEntity) this.loadedTileEntityList.get(tileTickPosition);
|
||||||
+
|
+
|
||||||
+ // Spigot start
|
+ // Spigot start
|
||||||
+ if (tileentity == null)
|
+ if (tileentity == null)
|
||||||
@ -1365,14 +1365,14 @@
|
|||||||
+
|
+
|
||||||
+ // Spigot start
|
+ // Spigot start
|
||||||
+ private void initLimiter() {
|
+ private void initLimiter() {
|
||||||
+ entityLimiter = new TickLimiter(spigotConfig.entityMaxTickTime);
|
+ entityLimiter = new TickLimiter(spigotConfig.entityMaxTickTime);
|
||||||
+ tileLimiter = new TickLimiter(spigotConfig.tileMaxTickTime);
|
+ tileLimiter = new TickLimiter(spigotConfig.tileMaxTickTime);
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
+
|
+
|
||||||
+ // Cauldron start
|
+ // Cauldron start
|
||||||
+ public boolean isProfilingWorld() {
|
+ public boolean isProfilingWorld() {
|
||||||
+ return provider.dimensionId == Integer.MIN_VALUE; // Mystcraft
|
+ return provider.dimensionId == Integer.MIN_VALUE; // Mystcraft
|
||||||
+ }
|
+ }
|
||||||
+ // Cauldron end
|
+ // Cauldron end
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@
|
|||||||
public void unloadAllChunks()
|
public void unloadAllChunks()
|
||||||
{
|
{
|
||||||
- Iterator iterator = this.loadedChunks.iterator();
|
- Iterator iterator = this.loadedChunks.iterator();
|
||||||
+ mUnloading = true;
|
+ mUnloading = true;
|
||||||
+ Iterator iterator = this.loadedChunkHashMap.values().iterator(); // CraftBukkit
|
+ Iterator iterator = this.loadedChunkHashMap.values().iterator(); // CraftBukkit
|
||||||
|
|
||||||
while (iterator.hasNext())
|
while (iterator.hasNext())
|
||||||
@ -119,7 +119,7 @@
|
|||||||
- long k = ChunkCoordIntPair.chunkXZ2Int(par1, par2);
|
- long k = ChunkCoordIntPair.chunkXZ2Int(par1, par2);
|
||||||
- this.chunksToUnload.remove(Long.valueOf(k));
|
- this.chunksToUnload.remove(Long.valueOf(k));
|
||||||
- Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(k);
|
- Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(k);
|
||||||
+ if (mUnloading) return null;
|
+ if (mUnloading) return null;
|
||||||
+ this.chunksToUnload.remove(par1, par2);
|
+ this.chunksToUnload.remove(par1, par2);
|
||||||
+ Chunk chunk = (Chunk) this.loadedChunkHashMap.get(LongHash.toLong(par1, par2));
|
+ Chunk chunk = (Chunk) this.loadedChunkHashMap.get(LongHash.toLong(par1, par2));
|
||||||
+ boolean newChunk = false;
|
+ boolean newChunk = false;
|
||||||
@ -142,7 +142,7 @@
|
|||||||
- long k = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_);
|
- long k = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_);
|
||||||
- this.chunksToUnload.remove(Long.valueOf(k));
|
- this.chunksToUnload.remove(Long.valueOf(k));
|
||||||
- Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(k);
|
- Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(k);
|
||||||
+ if (mUnloading) return null;
|
+ if (mUnloading) return null;
|
||||||
+ this.chunksToUnload.remove(p_73158_1_, p_73158_2_);
|
+ this.chunksToUnload.remove(p_73158_1_, p_73158_2_);
|
||||||
+ Chunk chunk = (Chunk) this.loadedChunkHashMap.get(LongHash.toLong(p_73158_1_, p_73158_2_));
|
+ Chunk chunk = (Chunk) this.loadedChunkHashMap.get(LongHash.toLong(p_73158_1_, p_73158_2_));
|
||||||
+ boolean newChunk = false; // CraftBukkit
|
+ boolean newChunk = false; // CraftBukkit
|
||||||
@ -213,7 +213,7 @@
|
|||||||
{
|
{
|
||||||
- Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(p_73154_1_, p_73154_2_));
|
- Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(p_73154_1_, p_73154_2_));
|
||||||
- return chunk == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(p_73154_1_, p_73154_2_)) : chunk;
|
- return chunk == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(p_73154_1_, p_73154_2_)) : chunk;
|
||||||
+ if (mUnloading) return null;
|
+ if (mUnloading) return null;
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ Chunk chunk = (Chunk) this.loadedChunkHashMap.get(LongHash.toLong(p_73154_1_, p_73154_2_));
|
+ Chunk chunk = (Chunk) this.loadedChunkHashMap.get(LongHash.toLong(p_73154_1_, p_73154_2_));
|
||||||
+ chunk = chunk == null ? (shouldLoadChunk() ? this.loadChunk(p_73154_1_, p_73154_2_) : this.defaultEmptyChunk) : chunk; // Cauldron handle forge server tick events and load the chunk within 5 seconds of the world being loaded (for chunk loaders)
|
+ chunk = chunk == null ? (shouldLoadChunk() ? this.loadChunk(p_73154_1_, p_73154_2_) : this.defaultEmptyChunk) : chunk; // Cauldron handle forge server tick events and load the chunk within 5 seconds of the world being loaded (for chunk loaders)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
public String getWorldName()
|
public String getWorldName()
|
||||||
{
|
{
|
||||||
- return this.theWorldInfo.getWorldName();
|
- return this.theWorldInfo.getWorldName();
|
||||||
+ String name = super.getWorldName();
|
+ String name = super.getWorldName();
|
||||||
+ return name != null ? name : this.theWorldInfo.getWorldName();
|
+ return name != null ? name : this.theWorldInfo.getWorldName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,15 +25,15 @@
|
|||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public int getDimension() {
|
+ public int getDimension() {
|
||||||
+ return this.theWorldInfo.getDimension();
|
+ return this.theWorldInfo.getDimension();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void setDimension(int dim) {
|
+ public void setDimension(int dim) {
|
||||||
+ this.theWorldInfo.setDimension(dim);
|
+ this.theWorldInfo.setDimension(dim);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void tick() {
|
+ public void tick() {
|
||||||
+ theWorldInfo.tick();
|
+ theWorldInfo.tick();
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,6 @@
|
|||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public void tick() {
|
+ public void tick() {
|
||||||
+ totalTime++;
|
+ totalTime++;
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
UNKNOWN;
|
UNKNOWN;
|
||||||
+
|
+
|
||||||
+ public boolean isPortal() {
|
+ public boolean isPortal() {
|
||||||
+ switch(this) {
|
+ switch(this) {
|
||||||
+ case NETHER_PORTAL:
|
+ case NETHER_PORTAL:
|
||||||
+ case END_PORTAL:
|
+ case END_PORTAL:
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user