From c427f60e15da7ffd663dcb4534e62a2f7afaacf1 Mon Sep 17 00:00:00 2001 From: Prototik Date: Mon, 1 Jun 2015 21:32:10 +0700 Subject: [PATCH] Normalize patches --- .../common/discovery/ModDiscoverer.java.patch | 16 +++++++-------- .../HandshakeCompletionHandler.java.patch | 4 ++-- .../fml/relauncher/CoreModManager.java.patch | 12 +++++------ .../net/minecraft/entity/Entity.java.patch | 2 +- .../entity/EntityLivingBase.java.patch | 6 +++--- .../entity/item/EntityItem.java.patch | 8 ++++---- .../minecraft/inventory/Container.java.patch | 2 +- .../net/minecraft/item/ItemStack.java.patch | 6 +++--- .../network/rcon/RConThreadClient.java.patch | 10 +++++----- .../ServerConfigurationManager.java.patch | 4 ++-- .../network/NetHandlerLoginServer.java.patch | 14 ++++++------- patches/net/minecraft/world/World.java.patch | 20 +++++++++---------- .../world/gen/ChunkProviderServer.java.patch | 8 ++++---- .../world/storage/DerivedWorldInfo.java.patch | 8 ++++---- .../world/storage/WorldInfo.java.patch | 2 +- .../player/PlayerTeleportEvent.java.patch | 12 +++++------ 16 files changed, 67 insertions(+), 67 deletions(-) diff --git a/patches/cpw/mods/fml/common/discovery/ModDiscoverer.java.patch b/patches/cpw/mods/fml/common/discovery/ModDiscoverer.java.patch index 166470a..8526e79 100644 --- a/patches/cpw/mods/fml/common/discovery/ModDiscoverer.java.patch +++ b/patches/cpw/mods/fml/common/discovery/ModDiscoverer.java.patch @@ -15,14 +15,14 @@ } + if (!"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) { -+ java.util.Iterator iterator = modList.iterator(); -+ while(iterator.hasNext()) { -+ ModContainer container = iterator.next(); -+ if ("FastCraft".equals(container.getModId())) { -+ FMLLog.log(Level.WARN, "Found FastCraft mod, removing it..."); -+ iterator.remove(); -+ } -+ } ++ java.util.Iterator iterator = modList.iterator(); ++ while(iterator.hasNext()) { ++ ModContainer container = iterator.next(); ++ if ("FastCraft".equals(container.getModId())) { ++ FMLLog.log(Level.WARN, "Found FastCraft mod, removing it..."); ++ iterator.remove(); ++ } ++ } + } + return modList; diff --git a/patches/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java.patch b/patches/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java.patch index 70f42c4..ed3f402 100644 --- a/patches/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java.patch +++ b/patches/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java.patch @@ -10,8 +10,8 @@ + io.netty.util.Attribute attr = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER); + if (attr != null) + { -+ NetworkDispatcher dispatcher = attr.getAndRemove(); -+ if (dispatcher != null) dispatcher.completeHandshake(msg.target); ++ NetworkDispatcher dispatcher = attr.getAndRemove(); ++ if (dispatcher != null) dispatcher.completeHandshake(msg.target); + } + // Cauldron end } diff --git a/patches/cpw/mods/fml/relauncher/CoreModManager.java.patch b/patches/cpw/mods/fml/relauncher/CoreModManager.java.patch index f5e1e1f..292ddcd 100644 --- a/patches/cpw/mods/fml/relauncher/CoreModManager.java.patch +++ b/patches/cpw/mods/fml/relauncher/CoreModManager.java.patch @@ -36,7 +36,7 @@ @Override public void injectIntoClassLoader(LaunchClassLoader classLoader) { -+ // Cauldron end ++ // Cauldron end FMLRelaunchLog.fine("Injecting coremod %s {%s} class transformers", name, coreModInstance.getClass().getName()); if (coreModInstance.getASMTransformerClass() != null) for (String transformer : coreModInstance.getASMTransformerClass()) { @@ -74,10 +74,10 @@ String cascadedTweaker = mfAttributes.getValue("TweakClass"); if (cascadedTweaker != null) { -+ if ("fastcraft.Tweaker".equals(cascadedTweaker) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) { -+ FMLRelaunchLog.info("Found FastCraft tweaker, skipping..."); -+ continue; -+ } ++ if ("fastcraft.Tweaker".equals(cascadedTweaker) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) { ++ FMLRelaunchLog.info("Found FastCraft tweaker, skipping..."); ++ continue; ++ } FMLRelaunchLog.info("Loading tweaker %s from %s", cascadedTweaker, coreMod.getName()); Integer sortOrder = Ints.tryParse(Strings.nullToEmpty(mfAttributes.getValue("TweakOrder"))); sortOrder = (sortOrder == null ? Integer.valueOf(0) : sortOrder); @@ -87,7 +87,7 @@ } + if ("fastcraft.LoadingPlugin".equals(fmlCorePlugin) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) { + FMLRelaunchLog.warning("Found FastCraft coremod, skipping..."); -+ continue; ++ continue; + } // Support things that are mod jars, but not FML mod jars try diff --git a/patches/net/minecraft/entity/Entity.java.patch b/patches/net/minecraft/entity/Entity.java.patch index 751045c..ed3280c 100644 --- a/patches/net/minecraft/entity/Entity.java.patch +++ b/patches/net/minecraft/entity/Entity.java.patch @@ -787,7 +787,7 @@ + + // Cauldron start + public boolean entityAllowedToSpawn() { -+ return true; ++ return true; + } + // Cauldron end } diff --git a/patches/net/minecraft/entity/EntityLivingBase.java.patch b/patches/net/minecraft/entity/EntityLivingBase.java.patch index 9af8a24..19d222a 100644 --- a/patches/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches/net/minecraft/entity/EntityLivingBase.java.patch @@ -532,10 +532,10 @@ + { + float armorDamage = (float) (event.getDamage() + event.getDamage(DamageModifier.BLOCKING) + event.getDamage(DamageModifier.HARD_HAT)); + if (this instanceof EntityPlayer) { -+ EntityPlayer player = (EntityPlayer) this; -+ armorDamage = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, damagesource, armorDamage, true); ++ EntityPlayer player = (EntityPlayer) this; ++ armorDamage = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, damagesource, armorDamage, true); + } else { -+ this.damageArmor(armorDamage); ++ this.damageArmor(armorDamage); + } + } + diff --git a/patches/net/minecraft/entity/item/EntityItem.java.patch b/patches/net/minecraft/entity/item/EntityItem.java.patch index 3ecec4f..facc73d 100644 --- a/patches/net/minecraft/entity/item/EntityItem.java.patch +++ b/patches/net/minecraft/entity/item/EntityItem.java.patch @@ -41,8 +41,8 @@ { ItemStack stack = this.getDataWatcher().getWatchableObjectItemStack(10); + if (stack == null || stack.stackSize == 0) { -+ setDead(); -+ return; ++ setDead(); ++ return; + } if (stack != null && stack.getItem() != null) { @@ -306,7 +306,7 @@ + + @Override + public boolean entityAllowedToSpawn() { -+ ItemStack stack = getDataWatcher().getWatchableObjectItemStack(10); -+ return stack != null && stack.getItem() != null && stack.stackSize > 0; ++ ItemStack stack = getDataWatcher().getWatchableObjectItemStack(10); ++ return stack != null && stack.getItem() != null && stack.stackSize > 0; + } } diff --git a/patches/net/minecraft/inventory/Container.java.patch b/patches/net/minecraft/inventory/Container.java.patch index 65d1f34..1c96806 100644 --- a/patches/net/minecraft/inventory/Container.java.patch +++ b/patches/net/minecraft/inventory/Container.java.patch @@ -226,7 +226,7 @@ + + // Spigot start + 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 } diff --git a/patches/net/minecraft/item/ItemStack.java.patch b/patches/net/minecraft/item/ItemStack.java.patch index 72934b9..40d504e 100644 --- a/patches/net/minecraft/item/ItemStack.java.patch +++ b/patches/net/minecraft/item/ItemStack.java.patch @@ -155,9 +155,9 @@ + + // Spigot start + public static boolean fastMatches(ItemStack is1, ItemStack is2) { -+ 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; -+ return false; ++ 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; ++ return false; + } + // Spigot end } diff --git a/patches/net/minecraft/network/rcon/RConThreadClient.java.patch b/patches/net/minecraft/network/rcon/RConThreadClient.java.patch index d13ca54..9be0228 100644 --- a/patches/net/minecraft/network/rcon/RConThreadClient.java.patch +++ b/patches/net/minecraft/network/rcon/RConThreadClient.java.patch @@ -10,8 +10,8 @@ - try - { - if (!this.running) -+ while (true) -+ { ++ while (true) ++ { + if (!this.running || clientSocket == null) { break; @@ -24,7 +24,7 @@ + + if (i < 10) { -+ this.running = false; // Cauldron ++ this.running = false; // Cauldron return; } @@ -32,7 +32,7 @@ continue; } } -+ } ++ } } catch (SocketTimeoutException sockettimeoutexception) { @@ -63,7 +63,7 @@ private void closeSocket() { -+ this.running = false; ++ this.running = false; if (null != this.clientSocket) { try diff --git a/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch index ae6ec28..9687079 100644 --- a/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -912,8 +912,8 @@ } + public int getMaxVisiblePlayers() { -+ int max = mcServer.cauldronConfig.maxPlayersVisible.getValue(); -+ return max > 0 ? max : maxPlayers; ++ int max = mcServer.cauldronConfig.maxPlayersVisible.getValue(); ++ return max > 0 ? max : maxPlayers; + } + public String[] getAvailablePlayerDat() diff --git a/patches/net/minecraft/server/network/NetHandlerLoginServer.java.patch b/patches/net/minecraft/server/network/NetHandlerLoginServer.java.patch index faaa33b..3011888 100644 --- a/patches/net/minecraft/server/network/NetHandlerLoginServer.java.patch +++ b/patches/net/minecraft/server/network/NetHandlerLoginServer.java.patch @@ -143,22 +143,22 @@ public void processLoginStart(C00PacketLoginStart p_147316_1_) { - 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]); 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()) { - 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_147333_a.scheduleOutboundPacket(new S01PacketEncryptionRequest(this.field_147334_j, this.field_147327_f.getKeyPair().getPublic(), this.field_147330_e), new GenericFutureListener[0]); } else { - 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 } } @@ -174,7 +174,7 @@ } 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_147328_g = NetHandlerLoginServer.LoginState.AUTHENTICATING; this.field_147333_a.enableEncryption(this.field_147335_k); @@ -223,7 +223,7 @@ - } - } - }).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(); } } @@ -246,7 +246,7 @@ + } + + 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; + } + diff --git a/patches/net/minecraft/world/World.java.patch b/patches/net/minecraft/world/World.java.patch index f2a429d..11cc236 100644 --- a/patches/net/minecraft/world/World.java.patch +++ b/patches/net/minecraft/world/World.java.patch @@ -256,7 +256,7 @@ + org.bukkit.World.Environment env) + { + this.spigotConfig = new org.spigotmc.SpigotWorldConfig(p_i45369_2_); // Spigot -+ initLimiter(); // Spigot ++ initLimiter(); // Spigot + // Cauldron start + this.cauldronConfig = new CauldronWorldConfig(p_i45369_2_, MinecraftServer.getServer().cauldronConfig); + this.tileentityConfig = new TileEntityWorldConfig(p_i45369_2_, MinecraftServer.getServer().tileEntityConfig); @@ -401,7 +401,7 @@ + if (DimensionManager.getWorld(0) != null) + { + 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.tileentityConfig = new TileEntityWorldConfig(p_i45369_2_, MinecraftServer.getServer().tileEntityConfig); + this.world = DimensionManager.getWorld(0).getWorld(); @@ -627,7 +627,7 @@ + + 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 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; + if (tickPosition < 0) tickPosition = 0; + 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); if (entity.ridingEntity != null) @@ -925,9 +925,9 @@ - if (!tileentity.isInvalid() && tileentity.hasWorldObj() && this.blockExists(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord)) + int tilesThisCycle = 0; + for (tileLimiter.initTick(); tilesThisCycle < loadedTileEntityList.size() && (tilesThisCycle % 10 == 0 || tileLimiter.shouldContinue()); tileTickPosition++, tilesThisCycle++) { -+ tileTickPosition = (tileTickPosition < loadedTileEntityList.size()) ? tileTickPosition : 0; -+ TileEntity tileentity = (TileEntity) this.loadedTileEntityList.get(tileTickPosition); -+ ++ tileTickPosition = (tileTickPosition < loadedTileEntityList.size()) ? tileTickPosition : 0; ++ TileEntity tileentity = (TileEntity) this.loadedTileEntityList.get(tileTickPosition); ++ + // Spigot start + if (tileentity == null) { @@ -1365,14 +1365,14 @@ + + // Spigot start + private void initLimiter() { -+ entityLimiter = new TickLimiter(spigotConfig.entityMaxTickTime); -+ tileLimiter = new TickLimiter(spigotConfig.tileMaxTickTime); ++ entityLimiter = new TickLimiter(spigotConfig.entityMaxTickTime); ++ tileLimiter = new TickLimiter(spigotConfig.tileMaxTickTime); + } + // Spigot end + + // Cauldron start + public boolean isProfilingWorld() { -+ return provider.dimensionId == Integer.MIN_VALUE; // Mystcraft ++ return provider.dimensionId == Integer.MIN_VALUE; // Mystcraft + } + // Cauldron end } diff --git a/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch index 3547346..de143f9 100644 --- a/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -100,7 +100,7 @@ public void unloadAllChunks() { - Iterator iterator = this.loadedChunks.iterator(); -+ mUnloading = true; ++ mUnloading = true; + Iterator iterator = this.loadedChunkHashMap.values().iterator(); // CraftBukkit while (iterator.hasNext()) @@ -119,7 +119,7 @@ - long k = ChunkCoordIntPair.chunkXZ2Int(par1, par2); - this.chunksToUnload.remove(Long.valueOf(k)); - Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(k); -+ if (mUnloading) return null; ++ if (mUnloading) return null; + this.chunksToUnload.remove(par1, par2); + Chunk chunk = (Chunk) this.loadedChunkHashMap.get(LongHash.toLong(par1, par2)); + boolean newChunk = false; @@ -142,7 +142,7 @@ - long k = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_); - this.chunksToUnload.remove(Long.valueOf(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_); + Chunk chunk = (Chunk) this.loadedChunkHashMap.get(LongHash.toLong(p_73158_1_, p_73158_2_)); + boolean newChunk = false; // CraftBukkit @@ -213,7 +213,7 @@ { - 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; -+ if (mUnloading) return null; ++ if (mUnloading) return null; + // CraftBukkit start + 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) diff --git a/patches/net/minecraft/world/storage/DerivedWorldInfo.java.patch b/patches/net/minecraft/world/storage/DerivedWorldInfo.java.patch index 823db97..dc66b8b 100644 --- a/patches/net/minecraft/world/storage/DerivedWorldInfo.java.patch +++ b/patches/net/minecraft/world/storage/DerivedWorldInfo.java.patch @@ -5,7 +5,7 @@ public String getWorldName() { - return this.theWorldInfo.getWorldName(); -+ String name = super.getWorldName(); ++ String name = super.getWorldName(); + return name != null ? name : this.theWorldInfo.getWorldName(); } @@ -25,15 +25,15 @@ } + + public int getDimension() { -+ return this.theWorldInfo.getDimension(); ++ return this.theWorldInfo.getDimension(); + } + + public void setDimension(int dim) { -+ this.theWorldInfo.setDimension(dim); ++ this.theWorldInfo.setDimension(dim); + } + + @Override + public void tick() { -+ theWorldInfo.tick(); ++ theWorldInfo.tick(); + } } diff --git a/patches/net/minecraft/world/storage/WorldInfo.java.patch b/patches/net/minecraft/world/storage/WorldInfo.java.patch index de5f08a..c233a1c 100644 --- a/patches/net/minecraft/world/storage/WorldInfo.java.patch +++ b/patches/net/minecraft/world/storage/WorldInfo.java.patch @@ -52,6 +52,6 @@ } + + public void tick() { -+ totalTime++; ++ totalTime++; + } } diff --git a/patches/org/bukkit/event/player/PlayerTeleportEvent.java.patch b/patches/org/bukkit/event/player/PlayerTeleportEvent.java.patch index 6344581..e0436c4 100644 --- a/patches/org/bukkit/event/player/PlayerTeleportEvent.java.patch +++ b/patches/org/bukkit/event/player/PlayerTeleportEvent.java.patch @@ -18,12 +18,12 @@ UNKNOWN; + + public boolean isPortal() { -+ switch(this) { -+ case NETHER_PORTAL: -+ case END_PORTAL: -+ return true; -+ } -+ return false; ++ switch(this) { ++ case NETHER_PORTAL: ++ case END_PORTAL: ++ return true; ++ } ++ return false; + } }